From 39097c0c474ea0a6f7b310fd5e7f63cce9c3b561 Mon Sep 17 00:00:00 2001 From: Xun Zhang Date: Mon, 13 Jun 2022 10:55:38 -0700 Subject: [PATCH] Use custom plugin to publish zips to maven (#343) Signed-off-by: Xun Zhang (cherry picked from commit f6e87701c2532839e0d6fb97d20216802b47227b) --- plugin/build.gradle | 24 ++++++++++++++++++++++++ scripts/build.sh | 1 + 2 files changed, 25 insertions(+) diff --git a/plugin/build.gradle b/plugin/build.gradle index 0b11b600cd..5b7fa8dc49 100644 --- a/plugin/build.gradle +++ b/plugin/build.gradle @@ -24,6 +24,7 @@ ext { apply plugin: 'opensearch.opensearchplugin' apply plugin: 'opensearch.testclusters' +apply plugin: 'opensearch.pluginzip' ext { projectSubstitutions = [:] licenseFile = rootProject.file('LICENSE.txt') @@ -53,6 +54,28 @@ dependencies { checkstyle "com.puppycrawl.tools:checkstyle:${project.checkstyle.toolVersion}" } +publishing { + publications { + pluginZip(MavenPublication) { publication -> + pom { + name = opensearchplugin.name + description = opensearchplugin.description + licenses { + license { + name = "The Apache License, Version 2.0" + url = "http://www.apache.org/licenses/LICENSE-2.0.txt" + } + } + developers { + developer { + name = "OpenSearch" + url = "https://github.com/opensearch-project/ml-commons" + } + } + } + } + } +} compileJava { options.compilerArgs.addAll(["-processor", 'lombok.launch.AnnotationProcessorHider$AnnotationProcessor']) @@ -238,6 +261,7 @@ configurations.all { resolutionStrategy.force 'junit:junit:4.12' resolutionStrategy.force 'org.apache.commons:commons-lang3:3.10' resolutionStrategy.force 'commons-logging:commons-logging:1.2' + resolutionStrategy.force 'org.objenesis:objenesis:3.2' } apply plugin: 'nebula.ospackage' diff --git a/scripts/build.sh b/scripts/build.sh index b7e915a066..d9d1038ac9 100644 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -69,6 +69,7 @@ fi ./gradlew publishToMavenLocal -Dopensearch.version=$VERSION -Dbuild.snapshot=$SNAPSHOT -Dbuild.version_qualifier=$QUALIFIER ./gradlew publishAllPublicationsToStagingRepository -Dopensearch.version=$VERSION -Dbuild.snapshot=$SNAPSHOT -Dbuild.version_qualifier=$QUALIFIER +./gradlew publishPluginZipPublicationToZipStagingRepository -Dopensearch.version=$VERSION -Dbuild.snapshot=$SNAPSHOT -Dbuild.version_qualifier=$QUALIFIER mkdir -p $OUTPUT/maven/org/opensearch cp -r ./build/local-staging-repo/org/opensearch/. $OUTPUT/maven/org/opensearch