Skip to content

Commit

Permalink
Use custom plugin to publish zips to maven (#343)
Browse files Browse the repository at this point in the history
Signed-off-by: Xun Zhang <xunzh@amazon.com>
(cherry picked from commit f6e8770)
  • Loading branch information
Zhangxunmt authored and github-actions[bot] committed Jun 13, 2022
1 parent f8f180a commit 39097c0
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
24 changes: 24 additions & 0 deletions plugin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ ext {

apply plugin: 'opensearch.opensearchplugin'
apply plugin: 'opensearch.testclusters'
apply plugin: 'opensearch.pluginzip'
ext {
projectSubstitutions = [:]
licenseFile = rootProject.file('LICENSE.txt')
Expand Down Expand Up @@ -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'])
Expand Down Expand Up @@ -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'
Expand Down
1 change: 1 addition & 0 deletions scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 39097c0

Please sign in to comment.