Loading
0

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>

参考:

最后编辑于:2020/12/8作者: 编程小战

我不入地狱,谁入地狱?

评论已关闭