maven使用gpg插件

在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
喜欢就支持一下吧
点赞0 分享