我一直在尝试将我的项目推入maven存储库,我正在尝试正确配置我的maven gpg插件,我目前将其用作
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.6</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>package</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
但它似乎找不到我的工件,因为它给出了rr
Failed to execute goal org.apache.maven.plugins:maven-gpg-plugin:1.6:sign (default-cli) on project fitnesse-bootstrap-plus-theme: The project artifact has not been assembled yet. Please do not invoke this goal before the lifecycle phase "package".
我的jar在root/target文件夹中生成。
当您需要安装/部署签名时,您应该将maven-gpg-plugin
绑定到阶段verify
,该阶段在package
阶段之后、install
和deploy
之前执行。
所以你的配置看起来像:
<plugins>
<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>
</execution>
</executions>
</plugin>
</plugins>
您也可以提交<phase>verify</phase>
,因为maven-gpg-plugin
是到正确阶段的默认绑定。