Skip to content

Commit

Permalink
Update maven publication to include cksums. (opensearch-project#91)
Browse files Browse the repository at this point in the history
This change adds a local staging repo task that will include cksums.  It will also update 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 <handalm@amazon.com>
  • Loading branch information
mch2 committed Nov 4, 2021
1 parent 3ecb3fb commit c423caf
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
16 changes: 6 additions & 10 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -157,17 +157,13 @@ task javadocJar(type: Jar) {
classifier = 'javadoc'
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
3 changes: 2 additions & 1 deletion scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,6 @@ fi

./gradlew build -Dopensearch.version=$VERSION -Dbuild.snapshot=$SNAPSHOT
./gradlew publishShadowPublicationToMavenLocal -Dopensearch.version=$VERSION -Dbuild.snapshot=$SNAPSHOT
./gradlew publishShadowPublicationToStagingRepository -Dopensearch.version=$VERSION -Dbuild.snapshot=$SNAPSHOT
mkdir -p $OUTPUT/maven/org/opensearch
cp -r ./build/libs $OUTPUT/maven/org/opensearch/common-utils
cp -r ./build/local-staging-repo/org/opensearch/common-utils $OUTPUT/maven/org/opensearch/common-utils

0 comments on commit c423caf

Please sign in to comment.