在pom的插件依赖中加入:
<plugins>
...
<!-- https://mvnrepository.com/artifact/org.apache.maven.plugins/maven-gpg-plugin -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.6</version>
<executions>
<execution>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
...
</plugins>
在maven的settings.xml中servers节点加入签名密钥,示例中为12345678,请自行替换:
<servers>
...
<server>
<id>gpg.passphrase</id>
<passphrase>12345678</passphrase>
</server>
...
</servers>
参考:
© 版权声明
文章版权归作者所有,未经允许请勿转载。
THE END













