Skip to content

Commit ac55169

Browse files
committed
#942 Remove use of nu.studer.credentials
Also switch to using gpg-cmd for signing
1 parent 55fac77 commit ac55169

4 files changed

Lines changed: 14 additions & 18 deletions

File tree

build-properties.gradle

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,6 @@ if (ext.buildJava == 8 && ext.testJava != ext.buildJava) {
4545
ext.'version.simple' = "${project.'version.major'}.${project.'version.minor'}.${project.'version.revision'}".toString()
4646
ext.'version.maven' = "${project.'version.simple'}.${project.'maven.jdkversion'}${project.'version.tag'}".toString()
4747

48-
ext.'signing.password' = credentials.forKey('signing.password')
49-
ext.centralPassword = credentials.forKey('centralPassword')
50-
5148
ext.isReleaseVersion = provider {
5249
!version.endsWith("SNAPSHOT")
5350
}

build.gradle

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ import org.asciidoctor.gradle.jvm.AsciidoctorTask
2828

2929
plugins {
3030
id 'java-library'
31-
id 'nu.studer.credentials' version '3.0'
3231
id 'maven-publish'
3332
id 'signing'
3433
id 'org.asciidoctor.jvm.convert' version '4.0.5'

devdoc/publish.md

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,11 @@ Publishing
88
To publish to Maven use
99

1010
```
11-
./gradlew clean dist assemble publish -PbuildProfile={8|11} -PcredentialsPassphrase=<credentials password>
11+
./gradlew clean dist assemble publish -PbuildProfile={8|11} -PcentralPassword=<value>
1212
```
13-
Where `<credentials password>` is the password used to add the credentials (see
14-
also below).
13+
14+
This command will prompt for you GPG key password if it's not already cached in
15+
your current session.
1516

1617
The `assemble` task is not strictly necessary, but will also generate the `dist`
1718
zip and sign it.
@@ -27,23 +28,21 @@ To be able to deploy, you need the following:
2728
a `<homedir>/.gradle/gradle.properties` with the following properties:
2829

2930
```
30-
signing.keyId=<gpg key id>
31-
signing.secretKeyRingFile=<path to your secring.gpg>
31+
signing.gnupg.keyName=<short keyid>
3232
3333
centralUsername=<Central Portal usertoken name>
34+
# Only needed if you don't want to specify -PcentralPassword=... on commandline
35+
centralPassword=<your Central Portal usertoken password>
3436
```
3537

36-
See also [Gradle: The Signing Plugin](https://docs.gradle.org/current/userguide/signing_plugin.html).
37-
38-
In addition, you need to set the following credentials
38+
(It's possible `signing.gnupg.keyName` also accepts long key-ids, we haven't checked.)
3939

40-
```
41-
./gradlew addCredentials --key signing.password --value <your secret key password> -PcredentialsPassphrase=<credentials password>
42-
./gradlew addCredentials --key centralPassword --value <your Central Portal usertoken password> -PcredentialsPassphrase=<credentials password>
43-
```
40+
Make sure the file is only readable and writable by you (chmod 600). If the
41+
password contains backslashes, make sure to escape them by doubling. If the
42+
password contains characters not in ISO 8859-1, make sure to use a Java Unicode
43+
escape.
4444

45-
See https://github.com/etiennestuder/gradle-credentials-plugin for details on
46-
credentials.
45+
See also [Gradle: The Signing Plugin](https://docs.gradle.org/current/userguide/signing_plugin.html).
4746

4847
## License Notice
4948

publish.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,7 @@ tasks.withType(PublishToMavenRepository).each {
188188
}
189189

190190
signing {
191+
useGpgCmd()
191192
required = { isReleaseVersion && gradle.taskGraph.hasTask(':publish') }
192193
sign publishing.publications.mavenJava
193194
sign dist

0 commit comments

Comments
 (0)