Skip to content

Commit 870a3b3

Browse files
Heiko KieselWeltraumschaf
authored andcommitted
Apply sonatype release requirements
Signed-off-by: Heiko Kiesel <heiko.kiesel@iteratec.com>
1 parent 7c88f91 commit 870a3b3

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

build.gradle

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ plugins {
88
id 'idea'
99
id 'maven-publish'
1010
id 'jacoco'
11+
id 'signing'
1112
// https://github.com/ben-manes/gradle-versions-plugin
1213
// Run: ./gradlew dependencyUpdates -Drevision=release
1314
id "com.github.ben-manes.versions" version "0.47.0"
@@ -21,6 +22,11 @@ repositories {
2122
mavenCentral()
2223
}
2324

25+
java {
26+
withJavadocJar()
27+
withSourcesJar()
28+
}
29+
2430
dependencies {
2531
implementation group: 'org.springframework', name: 'spring-web', version: '5.3.28'
2632
implementation group: 'org.apache.httpcomponents', name: 'httpclient', version: '4.5.14'
@@ -102,3 +108,21 @@ test {
102108
jacocoTestReport {
103109
dependsOn test // tests are required to run before generating the report
104110
}
111+
112+
// https://docs.gradle.org/current/userguide/signing_plugin.html
113+
signing {
114+
String signingKey = System.getenv("SIGNING_KEY")
115+
String signingPassword = System.getenv("SIGNING_PASSWORD")
116+
useInMemoryPgpKeys(signingKey, signingPassword)
117+
sign publishing.publications.jar
118+
}
119+
120+
// https://github.com/johnrengelman/shadow/issues/718
121+
tasks.withType(Zip).configureEach { task ->
122+
task.doLast {
123+
ant.checksum algorithm: 'md5', file: it.archivePath // required by sonatype
124+
ant.checksum algorithm: 'sha1', file: it.archivePath // required by sonatype
125+
ant.checksum algorithm: 'sha-256', file: it.archivePath, fileext: '.sha256'
126+
ant.checksum algorithm: 'sha-512', file: it.archivePath, fileext: '.sha512'
127+
}
128+
}

0 commit comments

Comments
 (0)