From c428d93cbce655b2f7e2b9595bd459b5236f65a5 Mon Sep 17 00:00:00 2001 From: Andriy Redko Date: Fri, 6 Jan 2023 09:55:47 -0500 Subject: [PATCH] Update nebula-publishing-plugin to 19.2.0 (#5704) Signed-off-by: Andriy Redko Signed-off-by: Andriy Redko (cherry picked from commit 3b51bc5bead2fde9674f8f989a8a390f9ecfa451) --- CHANGELOG.md | 1 + buildSrc/build.gradle | 2 +- .../opensearch/gradle/plugin/PluginBuildPlugin.groovy | 2 +- .../java/org/opensearch/gradle/PublishPlugin.java | 11 ++++++++--- distribution/archives/integ-test-zip/build.gradle | 1 + modules/build.gradle | 2 +- server/build.gradle | 2 +- 7 files changed, 14 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5f484a157c84f..04987b5cc9b29 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) - Bump `com.google.guava:guava` from 31.0.1-jre to 32.0.1-jre ([#8107](https://github.com/opensearch-project/OpenSearch/pull/8107)) - Bump versions of gradle-info-plugin and nebula-publishing-plugin ([#8150](https://github.com/opensearch-project/OpenSearch/pull/8150)) - Bump `json-smart` from 2.4.7 to 2.4.11 in plugins/repository-hdfs/ ([#8160](https://github.com/opensearch-project/OpenSearch/pull/8160)) +- Update nebula-publishing-plugin to 19.2.0 ([#5704](https://github.com/opensearch-project/OpenSearch/pull/5704)) ### Changed diff --git a/buildSrc/build.gradle b/buildSrc/build.gradle index f3c12110dde99..0baa24db28075 100644 --- a/buildSrc/build.gradle +++ b/buildSrc/build.gradle @@ -105,8 +105,8 @@ dependencies { api 'commons-codec:commons-codec:1.15' api 'org.apache.commons:commons-compress:1.21' api 'org.apache.ant:ant:1.10.12' - api 'com.netflix.nebula:nebula-publishing-plugin:4.7.0' api 'com.netflix.nebula:gradle-extra-configurations-plugin:8.0.0' + api 'com.netflix.nebula:nebula-publishing-plugin:19.2.0' api 'com.netflix.nebula:gradle-info-plugin:12.0.0' api 'org.apache.rat:apache-rat:0.13' 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 427e3f2740a89..1207f12d4d745 100644 --- a/buildSrc/src/main/groovy/org/opensearch/gradle/plugin/PluginBuildPlugin.groovy +++ b/buildSrc/src/main/groovy/org/opensearch/gradle/plugin/PluginBuildPlugin.groovy @@ -143,7 +143,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 e2bd3e71f5fc9..b0314a4a95d47 100644 --- a/buildSrc/src/main/java/org/opensearch/gradle/PublishPlugin.java +++ b/buildSrc/src/main/java/org/opensearch/gradle/PublishPlugin.java @@ -63,7 +63,8 @@ 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-base-publish"); + project.getPluginManager().apply("com.netflix.nebula.maven-nebula-publish"); project.getPluginManager().apply(PomValidationPrecommitPlugin.class); configureJavadocJar(project); @@ -104,8 +105,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.getCONFIGURATION_NAME()).getAllDependencies().all(dependency -> { if (dependency instanceof ProjectDependency) { 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 aa467cd0528bf..a83a1090d5449 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' } }