@@ -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+
2430dependencies {
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 {
102108jacocoTestReport {
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