0

我已经正确配置了 GPG,并且 MAVEN 也引用了正确的 KEY。这一直有效。现在一些Maven总是给出以下错误:

gpg: skipped "39619BDF": No secret key
gpg: signing failed: No secret key

(我不确定它是否与使用 JDK11 而不是 JDK 8 无关)

马文settings.xml有:

<profile>
      <id>ossrh</id>
      <activation>
        <activeByDefault>true</activeByDefault>
      </activation>
      <properties>
        <gpg.executable>gpg2</gpg.executable>
        <gpg.passphrase>xxxxxxxxx</gpg.passphrase>
        <gpg.keyname>39619BDF</gpg.keyname>
      </properties>
    </profile>
  </profiles>

命令gpg2 --edit-key 39619BDF显示:

gpg (GnuPG) 2.0.29; Copyright (C) 2015 Free Software Foundation, Inc.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.


pub  2048R/39619BDF  created: 2016-01-27  expires: never       usage: SC
                     trust: ultimate      validity: ultimate
sub  2048R/9AE84F82  created: 2016-01-27  expires: never       usage: E
[ultimate] (1). Miguel Gamboa (Miguel Gamboa works at CC.ISEL.IPL.PT) <miguelgamboa@outlook.com>

我唯一注意到的是缺少Secret key is available出现在 Maven 文档中的消息:https ://central.sonatype.org/pages/working-with-pgp-signatures.html#dealing-with-expired-keys

4

1 回答 1

0

我没有意识到这个问题背后的原因。

我刚刚生成了一个新的 GPG 密钥,它现在显示了消息Secret key is available,我替换了 Maven 中的密钥settings.xml,现在构建工作正常,对工件进行签名。

然而,我不知道为什么会这样。

于 2019-08-06T15:05:49.527 回答