我正在尝试将我的学校项目添加到maven库中。我正在学习这个教程:https://blog.sonatype.com/2010/01/how-to-generate-pgp-signatures-with-maven/。我已经成功地生成了密钥和密码,并且我已经将来自该链接的插件添加到了我的pom文件中。
当我运行命令mvn clean deploy -Dgpg.passphrase=mypassphrase时,它显示
[ERROR] Unknown lifecycle phase ".passphrase=...". You must specify a valid lifecycle phase or a goal in
the format <plugin-prefix>:<goal> or <plugin-group-id>:<plugin-artifact-id>[:<plugin-version>]:<goal>.
Available lifecycle phases are: validate, initialize, generate-sources, process-sources, generate-
resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources,
generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-
package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy,
pre-clean, clean, post-clean, pre-site, site, post-site, site-deploy. -> [Help 1]如果我只运行mvn clean deploy,它会显示
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-gpg-plugin:1.6:sign (sign-artifacts) on
project game-engine: Unable to execute gpg command: Error while executing process.
Cannot run program "gpg.exe": CreateProcess error=2, The system cannot find the file specified -> [Help 1]我试着用谷歌搜索这个,但我找不到完全相同的问题。我在Windows10上运行这个项目。
发布于 2021-02-10 03:22:18
代替使用maven-gpg-plugin进行签名,你可以尝试另一个插件https://www.simplify4u.org/sign-maven-plugin/,它的签名不需要像gpg这样的外部软件。
sign-maven-plugin内部使用Bouncy Castle库,因此签名过程不依赖于操作系统。
它也不依赖于您所使用conslole,如果您可以运行maven构建签名将工作。
https://stackoverflow.com/questions/59281804
复制相似问题