Skip to content

Commit

Permalink
Update maven publication to include cksums. (#224)
Browse files Browse the repository at this point in the history
This change adds a task to publish to a local staging repo under build/ that includes cksums.  It also updates build.sh to use this new task and copy the contents of the staging repo to the output directory.
The maven publish plugin will not include these cksums when publishing to maven local but will when published to a separate folder.

Signed-off-by: Marc Handalian <[email protected]>
  • Loading branch information
mch2 authored Nov 5, 2021
1 parent 8b337e7 commit 621d75e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
15 changes: 6 additions & 9 deletions notification/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -57,16 +57,13 @@ task javadocJar(type: Jar) {
from javadoc.destinationDir
}

tasks.withType(Jar) { task ->
task.doLast {
ant.checksum algorithm: 'md5', file: it.archivePath
ant.checksum algorithm: 'sha1', file: it.archivePath
ant.checksum algorithm: 'sha-256', file: it.archivePath, fileext: '.sha256'
ant.checksum algorithm: 'sha-512', file: it.archivePath, fileext: '.sha512'
}
}

publishing {
repositories {
maven {
name = 'staging'
url = "${rootProject.buildDir}/local-staging-repo"
}
}
publications {
shadow(MavenPublication) {
project.shadow.component(it)
Expand Down
4 changes: 3 additions & 1 deletion scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@ echo "COPY ${distributions}/*.zip"
cp ${distributions}/*.zip ./$OUTPUT/plugins

./gradlew publishShadowPublicationToMavenLocal -Dopensearch.version=$VERSION -Dbuild.snapshot=$SNAPSHOT -x ktlint
./gradlew publishShadowPublicationToStagingRepository -Dopensearch.version=$VERSION -Dbuild.snapshot=$SNAPSHOT

mkdir -p $OUTPUT/maven/org/opensearch
cp -r ./notification/build/libs $OUTPUT/maven/org/opensearch/notification
cp -r ./build/local-staging-repo/org/opensearch/notification $OUTPUT/maven/org/opensearch/notification


0 comments on commit 621d75e

Please sign in to comment.