diff --git a/buildSrc/build.gradle b/buildSrc/build.gradle index 2669e5ebfdc8b..2cb6436ff5b3d 100644 --- a/buildSrc/build.gradle +++ b/buildSrc/build.gradle @@ -106,7 +106,7 @@ dependencies { api 'org.apache.commons:commons-compress:1.22' api 'org.apache.ant:ant:1.10.12' api 'com.netflix.nebula:gradle-extra-configurations-plugin:8.0.0' - api 'com.netflix.nebula:nebula-publishing-plugin:4.6.0' + api 'com.netflix.nebula:nebula-publishing-plugin:19.1.0' api 'com.netflix.nebula:gradle-info-plugin:12.0.0' api 'org.apache.rat:apache-rat:0.15' api 'commons-io:commons-io:2.7' diff --git a/buildSrc/src/main/groovy/org/opensearch/gradle/plugin/PluginBuildPlugin.groovy b/buildSrc/src/main/groovy/org/opensearch/gradle/plugin/PluginBuildPlugin.groovy index b7c78991a0da3..2428d9e2fa4fa 100644 --- a/buildSrc/src/main/groovy/org/opensearch/gradle/plugin/PluginBuildPlugin.groovy +++ b/buildSrc/src/main/groovy/org/opensearch/gradle/plugin/PluginBuildPlugin.groovy @@ -149,7 +149,7 @@ class PluginBuildPlugin implements Plugin { private void configurePublishing(Project project, PluginPropertiesExtension extension) { // Only configure publishing if applied externally if (extension.hasClientJar) { - project.pluginManager.apply('nebula.maven-base-publish') + project.pluginManager.apply('com.netflix.nebula.maven-base-publish') // Only change Jar tasks, we don't want a -client zip so we can't change archivesBaseName project.tasks.withType(Jar) { archiveBaseName = archiveBaseName.get() + "-client" diff --git a/buildSrc/src/main/java/org/opensearch/gradle/PublishPlugin.java b/buildSrc/src/main/java/org/opensearch/gradle/PublishPlugin.java index be12fdd99c1df..71de6f2165b19 100644 --- a/buildSrc/src/main/java/org/opensearch/gradle/PublishPlugin.java +++ b/buildSrc/src/main/java/org/opensearch/gradle/PublishPlugin.java @@ -67,7 +67,7 @@ public class PublishPlugin implements Plugin { @Override public void apply(Project project) { - project.getPluginManager().apply("nebula.maven-base-publish"); + project.getPluginManager().apply("com.netflix.nebula.maven-publish"); project.getPluginManager().apply(PomValidationPrecommitPlugin.class); configureJavadocJar(project); @@ -108,8 +108,12 @@ public String call() throws Exception { // Here we manually add any project dependencies in the "shadow" configuration to our generated POM publication.getPom().withXml(xml -> { Node root = xml.asNode(); - root.appendNode("name", project.getName()); - root.appendNode("description", project.getDescription()); + if (((NodeList) root.get("name")).isEmpty()) { + root.appendNode("name", project.getName()); + } + if (((NodeList) root.get("description")).isEmpty()) { + root.appendNode("description", project.getDescription()); + } Node dependenciesNode = (Node) ((NodeList) root.get("dependencies")).get(0); project.getConfigurations().getByName(ShadowBasePlugin.CONFIGURATION_NAME).getAllDependencies().all(dependency -> { if (dependency instanceof ProjectDependency) { diff --git a/buildSrc/src/main/java/org/opensearch/gradle/pluginzip/Publish.java b/buildSrc/src/main/java/org/opensearch/gradle/pluginzip/Publish.java index 6b581fcaa7774..0b9e9c408e982 100644 --- a/buildSrc/src/main/java/org/opensearch/gradle/pluginzip/Publish.java +++ b/buildSrc/src/main/java/org/opensearch/gradle/pluginzip/Publish.java @@ -59,7 +59,7 @@ private void addZipArtifact(Project project) { @Override public void apply(Project project) { - project.getPluginManager().apply("nebula.maven-base-publish"); + project.getPluginManager().apply("com.netflix.nebula.maven-base-publish"); project.getPluginManager().apply(MavenPublishPlugin.class); project.afterEvaluate(evaluatedProject -> { if (isZipPublicationPresent(project)) { diff --git a/buildSrc/src/test/java/org/opensearch/gradle/pluginzip/PublishTests.java b/buildSrc/src/test/java/org/opensearch/gradle/pluginzip/PublishTests.java index 148a836f32b41..da5d18b1a47f1 100644 --- a/buildSrc/src/test/java/org/opensearch/gradle/pluginzip/PublishTests.java +++ b/buildSrc/src/test/java/org/opensearch/gradle/pluginzip/PublishTests.java @@ -89,7 +89,7 @@ public void applyZipPublicationPluginNoConfig() { project.getTasks().size() ); - // Tasks applied from "nebula.maven-base-publish" + // Tasks applied from "com.netflix.nebula.maven-base-publish" assertTrue( project.getTasks() .findByName("generateMetadataFileForNebulaPublication") instanceof org.gradle.api.publish.tasks.GenerateModuleMetadata diff --git a/distribution/archives/integ-test-zip/build.gradle b/distribution/archives/integ-test-zip/build.gradle index 35c5a9b60b568..f3f848797961c 100644 --- a/distribution/archives/integ-test-zip/build.gradle +++ b/distribution/archives/integ-test-zip/build.gradle @@ -34,6 +34,7 @@ apply plugin: 'opensearch.rest-test' // The integ-test-distribution is published to maven apply plugin: 'opensearch.publish' +apply plugin: 'com.netflix.nebula.maven-publish' group = "org.opensearch.distribution.integ-test-zip" diff --git a/modules/build.gradle b/modules/build.gradle index b493c4a577cec..126bf0c8870ac 100644 --- a/modules/build.gradle +++ b/modules/build.gradle @@ -32,7 +32,7 @@ configure(subprojects.findAll { it.parent.path == project.path }) { group = 'org.opensearch.plugin' // for modules which publish client jars apply plugin: 'opensearch.testclusters' apply plugin: 'opensearch.opensearchplugin' - + opensearchplugin { // for local OpenSearch plugins, the name of the plugin is the same as the directory name project.name diff --git a/server/build.gradle b/server/build.gradle index ae79ea2dabc29..1172fddd04e51 100644 --- a/server/build.gradle +++ b/server/build.gradle @@ -37,7 +37,7 @@ apply plugin: 'opensearch.internal-cluster-test' publishing { publications { - nebula { + nebula(MavenPublication) { artifactId 'opensearch' } }