diff --git a/build.gradle b/build.gradle index d668d2eff..b7d3a8875 100644 --- a/build.gradle +++ b/build.gradle @@ -43,6 +43,7 @@ plugins { apply from: 'gradle/formatting.gradle' apply plugin: 'opensearch.opensearchplugin' apply plugin: 'opensearch.rest-test' +apply plugin: 'opensearch.pluginzip' ext { isSnapshot = "true" == System.getProperty("build.snapshot", "true") @@ -80,6 +81,29 @@ allprojects { } } +publishing { + publications { + pluginZip(MavenPublication) { publication -> + pom { + name = "opensearch-knn" + description = "OpenSearch k-NN plugin" + 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/k-NN" + } + } + } + } + } +} + compileJava { options.compilerArgs.addAll(["-processor", 'lombok.launch.AnnotationProcessorHider$AnnotationProcessor']) } diff --git a/scripts/build.sh b/scripts/build.sh index e495461a2..2ff2bc2b6 100644 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -100,6 +100,7 @@ make opensearchknn_faiss opensearchknn_nmslib cd $work_dir ./gradlew assemble --no-daemon --refresh-dependencies -DskipTests=true -Dopensearch.version=$VERSION -Dbuild.snapshot=$SNAPSHOT -Dbuild.version_qualifier=$QUALIFIER +./gradlew publishPluginZipPublicationToZipStagingRepository -Dopensearch.version=$VERSION -Dbuild.snapshot=$SNAPSHOT -Dbuild.version_qualifier=$QUALIFIER # Add lib to zip zipPath=$(find "$(pwd)" -path \*build/distributions/*.zip) @@ -118,3 +119,6 @@ cd $work_dir echo "COPY ${distributions}/*.zip" mkdir -p $OUTPUT/plugins cp ${distributions}/*.zip $OUTPUT/plugins + +mkdir -p $OUTPUT/maven/org/opensearch +cp -r ./build/local-staging-repo/org/opensearch/. $OUTPUT/maven/org/opensearch diff --git a/settings.gradle b/settings.gradle index 483465c89..9056e382e 100644 --- a/settings.gradle +++ b/settings.gradle @@ -8,3 +8,4 @@ rootProject.name = 'opensearch-knn' include ":qa" include ":qa:rolling-upgrade" include ":qa:restart-upgrade" +