How to sign with gradle and gpg2

The graring signature plugin requires the keyring.gpg keyring file, according to the documentation: https://docs.gradle.org/current/userguide/signing_plugin.html

But since the gpg version is version 2.1, secring.gpg no longer exists. https://www.gnupg.org/faq/whats-new-in-2.1.html

Is it possible to use the gradle signature plugin with gpg> = 2.1?

+6
source share
2 answers

I just ran into the same problem and solved it manually by creating the secring.gpg file by running the following terminal command:

gpg --keyring secring.gpg --export-secret-key XXXXXXXX > secring.gpg 

You must replace XXXXXXXX with the identifier of the key you want to use. You can list all available keys using the gpg --list-key command.

Edit: I forgot to mention that I use Linux.

+5
source

I also ran into the same problem that I could not solve with gpg --export-secret-key like this.

gpg: ATTENTION: nothing exported

In fact, my version of gpg was 1.4.xx (with gpg --version ) and it was different: gpg2 .

So try the following:

 gpg2 --export-secret-key XXXXXXXX > secring.gpg 
+2
source

All Articles