Gradle uploadArchives task unable to read secret key

后端 未结 3 1651
悲&欢浪女
悲&欢浪女 2021-02-04 04:54

I have created a gradle project and everything builds fine, but when I try to upload to my Maven repository, I get the following Gradle error:

FAILURE: Build fai         


        
相关标签:
3条回答
  • 2021-02-04 05:19

    The secring.gpg file has been removed in GPG 2.1.

    However, GPG still can create such a file: gpg --export-secret-keys -o secring.gpg

    Pro Tip: If Gradle's signing plugin complains that your key in signing.keyId=MY_KEY_ID is too long, you're certainly using the 40 characters fingerprint but are asked for the 8 char ID. You've got two options then:

    1. You can configure GPG to show the 8 char ID instead of the fingerprint by setting the keyid-format option.

      • Explicitly define this option on CLI: gpg --list-keys --keyid-format short (Thanks tjheslin1!)
      • Make this option implicitly active through the options file (default "~/.gnupg/gpg.conf").
    2. Try the last 8 digits of your 40 chars fingerprint. This is for the lazy developer ;-)

    0 讨论(0)
  • 2021-02-04 05:24

    The "secring.gpg" file may not be needed in GPG 2.1 and later versions, and can be generated with commands: "gpg --export-secret-keys -o \dir\secring.gpg"

    0 讨论(0)
  • 2021-02-04 05:37

    The problem is that you are using the public key, switch to the secret key, normally named "secring.gpg". So in your case it should placed in

    C:\Users\ideal\secring.gpg

    0 讨论(0)
提交回复
热议问题