Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backport 1.x] Update nebula-publishing-plugin to 19.2.0 #8227

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- 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))
- Bump `netty` from 4.1.93.Final to 4.1.94.Final ([#8191](https://github.com/opensearch-project/OpenSearch/pull/8191))
- Update nebula-publishing-plugin to 19.2.0 ([#5704](https://github.com/opensearch-project/OpenSearch/pull/5704))
- Bump `gradle.plugin.com.github.johnrengelman:shadow` from 7.1.2 to 8.0.0

### Changed

Expand Down
8 changes: 4 additions & 4 deletions buildSrc/build.gradle
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you will need to update com.github.jengelman.gradle.plugins:shadow:6.0.0 as well. You will probably see an issue with the getCONFIGURATION_NAME call in the PluginBuildPlugin.groovy file below.

Original file line number Diff line number Diff line change
Expand Up @@ -105,14 +105,14 @@ 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:gradle-extra-configurations-plugin:3.0.3'
api 'com.netflix.nebula:nebula-publishing-plugin:4.7.0'
api 'com.netflix.nebula:gradle-info-plugin:8.2.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'
api "net.java.dev.jna:jna:5.5.0"
api 'com.github.jengelman.gradle.plugins:shadow:6.0.0'
api 'de.thetaphi:forbiddenapis:3.2'
api 'gradle.plugin.com.github.johnrengelman:shadow:8.0.0'
api 'com.avast.gradle:gradle-docker-compose-plugin:0.14.12'
api "org.yaml:snakeyaml:${props.getProperty('snakeyaml')}"
api 'org.apache.maven:maven-model:3.6.2'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ class PluginBuildPlugin implements Plugin<Project> {
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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -256,10 +256,10 @@ private static void configureJarManifest(Project project) {
);
});

project.getPluginManager().apply("nebula.info-broker");
project.getPluginManager().apply("nebula.info-basic");
project.getPluginManager().apply("nebula.info-java");
project.getPluginManager().apply("nebula.info-jar");
project.getPluginManager().apply("com.netflix.nebula.info-broker");
project.getPluginManager().apply("com.netflix.nebula.info-basic");
project.getPluginManager().apply("com.netflix.nebula.info-java");
project.getPluginManager().apply("com.netflix.nebula.info-jar");
}

private static void configureJavadoc(Project project) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ public void execute(Task t) {
.getByName(SourceSet.MAIN_SOURCE_SET_NAME)
.getRuntimeClasspath();
// Add any "shadow" dependencies. These are dependencies that are *not* bundled into the shadow JAR
Configuration shadowConfig = project.getConfigurations().getByName(ShadowBasePlugin.getCONFIGURATION_NAME());
Configuration shadowConfig = project.getConfigurations().getByName(ShadowBasePlugin.CONFIGURATION_NAME);
// Add the shadow JAR artifact itself
FileCollection shadowJar = project.files(project.getTasks().named("shadowJar"));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ public class PublishPlugin implements Plugin<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("com.netflix.nebula.maven-nebula-publish");
project.getPluginManager().apply(PomValidationPrecommitPlugin.class);

configureJavadocJar(project);
Expand Down Expand Up @@ -104,10 +105,14 @@ 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 -> {
project.getConfigurations().getByName(ShadowBasePlugin.CONFIGURATION_NAME).getAllDependencies().all(dependency -> {
if (dependency instanceof ProjectDependency) {
Node dependencyNode = dependenciesNode.appendNode("dependency");
dependencyNode.appendNode("groupId", dependency.getGroup());
Expand Down
1 change: 1 addition & 0 deletions distribution/archives/integ-test-zip/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
2 changes: 1 addition & 1 deletion modules/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion server/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ apply plugin: 'opensearch.internal-cluster-test'

publishing {
publications {
nebula {
nebula(MavenPublication) {
artifactId 'opensearch'
}
}
Expand Down