【发布时间】:2017-07-30 16:29:10
【问题描述】:
我正在使用 Apache Maven GPG 插件 maven-gpg-plugin 生成所需的签名,以通过 OSSRH 在 Maven Central 中发布。我在 pom.xml 中的插件定义如下,我的 OSSRH 凭据在 Maven conf/settings.xml 中,一切正常。但是,当另一个开发人员尝试mvn install 时,他失败了,因为他没有安装 GPG。除了开发人员进行部署之外,我想避免安装 GPG,可能通过在构建期间忽略 maven-gpg-plugin 错误或通过任何其他方式,这样我就不需要两个 pom.xml 一个与插件-in 和另一个没有它。
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.6</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
<configuration>
<keyname>${gpg.keyname}</keyname>
<passphraseServerId>${gpg.passphrase}</passphraseServerId>
</configuration>
</execution>
</executions>
</plugin>
【问题讨论】:
标签: maven maven-plugin maven-central gpg-signature maven-gpg-plugin