File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed
Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -111,7 +111,6 @@ publishing {
111111 // def snapshotsRepoUrl = layout.buildDirectory.dir('repos/snapshots')
112112 url = version. endsWith(' SNAPSHOT' ) ? snapshotsRepoUrl : releasesRepoUrl
113113 credentials {
114-
115114 username = project. hasProperty(' ossrhUsername' ) ? ossrhUsername : System . getenv(" OSSRH_USERNAME" )
116115 password = project. hasProperty(' ossrhPassword' ) ? ossrhPassword : System . getenv(" OSSRH_TOKEN" )
117116 }
@@ -120,10 +119,14 @@ publishing {
120119}
121120
122121signing {
123- def signingKey = System . getenv(" OSSRH_GPG_SECRET_KEY" )
124- def signingPassword = System . getenv(" OSSRH_GPG_PASSWORD" )
125- useInMemoryPgpKeys(signingKey, signingPassword)
126- sign publishing. publications. mavenJava
122+ if (project. hasProperty(' signing.keyId' )) {
123+ sign publishing. publications. mavenJava
124+ } else {
125+ def signingKey = System . getenv(" OSSRH_GPG_SECRET_KEY" )
126+ def signingPassword = System . getenv(" OSSRH_GPG_PASSWORD" )
127+ useInMemoryPgpKeys(signingKey, signingPassword)
128+ sign publishing. publications. mavenJava
129+ }
127130}
128131
129132
You can’t perform that action at this time.
0 commit comments