Skip to content

Commit b39f8e1

Browse files
mch2zelinh
authored andcommitted
Update maven publication to include cksums. (#91)
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> Signed-off-by: Zelin Hao <zelinhao@amazon.com>
1 parent ccbaef7 commit b39f8e1

File tree

2 files changed

+8
-11
lines changed

2 files changed

+8
-11
lines changed

build.gradle

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -157,17 +157,13 @@ task javadocJar(type: Jar) {
157157
classifier = 'javadoc'
158158
from javadoc.destinationDir
159159
}
160-
161-
tasks.withType(Jar) { task ->
162-
task.doLast {
163-
ant.checksum algorithm: 'md5', file: it.archivePath
164-
ant.checksum algorithm: 'sha1', file: it.archivePath
165-
ant.checksum algorithm: 'sha-256', file: it.archivePath, fileext: '.sha256'
166-
ant.checksum algorithm: 'sha-512', file: it.archivePath, fileext: '.sha512'
167-
}
168-
}
169-
170160
publishing {
161+
repositories {
162+
maven {
163+
name = 'staging'
164+
url = "${rootProject.buildDir}/local-staging-repo"
165+
}
166+
}
171167
publications {
172168
shadow(MavenPublication) {
173169
project.shadow.component(it)

scripts/build.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,5 +57,6 @@ fi
5757

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

0 commit comments

Comments
 (0)