我按照这里列出的所有说明将我的项目发布到sonatype repo:https://dzone.com/articles/publish-your-artifacts-to-maven-central,但在对工件进行签名时仍然出现以下错误
[INFO] --- maven-gpg-plugin:3.0.1:sign (sign-artifacts) @ exceptionless-client ---
gpg: skipped "0x9d0e3e1d": No secret key
gpg: signing failed: No secret key
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 42.750 s
[INFO] Finished at: 2021-08-03T10:52:18+05:30
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-gpg-plugin:3.0.1:sign (sign-artifacts) on project exceptionless-client: Exit code: 2 -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please rezad the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
运行gpg --list-key
命令时,我可以看到列出的密钥。
发布于 2021-08-03 05:48:51
我使用git bash来生成新的密钥,但我不知道git bash还附带了一个捆绑的gpg
程序,而且它正在使用它。但是,maven-gpg-plugin
试图使用安装在C:/Program Files(x86)
下的gpg程序查找密钥。在我使用这个创建了密钥之后,我安装了它,它工作得很好。
https://stackoverflow.com/questions/68630948
复制相似问题