我已经正确配置了 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