Skip to content

Commit

Permalink
Convert the publishing plugin to Java
Browse files Browse the repository at this point in the history
This commit is a potential breaking change: it converts the publishing
plugin to Java (to make things easier to maintain), and removed in
the process support for the `extraPomInfo`, `startPomInfo` and
`pomInfo` closures which were used to tweak the generated pom files. If
tweaking is required, then this must be done via the type-safe API
instead.

Relates to #536
  • Loading branch information
melix committed Mar 10, 2023
1 parent 1440aff commit 02f23ae
Show file tree
Hide file tree
Showing 4 changed files with 201 additions and 298 deletions.
6 changes: 0 additions & 6 deletions src/main/groovy/io/micronaut/build/MicronautBomPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
*/
package io.micronaut.build;

import groovy.lang.Closure;
import groovy.namespace.QName;
import groovy.util.Node;
import io.micronaut.build.catalogs.internal.LenientVersionCatalogParser;
Expand Down Expand Up @@ -184,7 +183,6 @@ private void configureBOM(Project project, MicronautBomExtension bomExtension) {
PublishingExtension publishing = project.getExtensions().getByType(PublishingExtension.class);
JavaPlatformExtension javaPlatformExtension = project.getExtensions().getByType(JavaPlatformExtension.class);
javaPlatformExtension.allowDependencies();
publishing.getPublications().create("maven", MavenPublication.class);
TaskContainer tasks = project.getTasks();
project.afterEvaluate(unused -> configureLate(project, bomExtension, publishing, tasks));

Expand Down Expand Up @@ -214,10 +212,6 @@ private void configureLate(Project project, MicronautBomExtension bomExtension,
pom.setPackaging("pom");
pom.withXml(xml -> {
Node node = xml.asNode();
Optional<Node> packagingNode = Optional.ofNullable(childOf(node, "packaging"));
if (project.hasProperty("pomInfo")) {
packagingNode.ifPresent(packaging -> packaging.plus((Closure) project.findProperty("pomInfo")));
}
modelConverter.getModel().getLibrariesTable().forEach(library -> {
String alias = Optional.ofNullable(library.getVersion().getReference()).map(a -> a.replace('-', '.')).orElse("");
String libraryAlias = Optional.ofNullable(library.getAlias()).map(a -> a.replace('-', '.')).orElse("");
Expand Down
292 changes: 0 additions & 292 deletions src/main/groovy/io/micronaut/build/MicronautPublishingPlugin.groovy

This file was deleted.

Loading

0 comments on commit 02f23ae

Please sign in to comment.