打包報錯,
mvn install后加上參數-Dgpg.skip,例如:mvn install -Dgpg.skip
即可解決。
我們也可以去掉 這個 插件
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
或者打包的時候 不用 install 命令,
用 package 這個打包命令 mvn clean package 也是可以的
注意:
1.install:打包好的 jar 包會安裝到本地的 maven 倉庫中,使用的配置是默認的配置,供其他項目使用。
2.package 指定參數打包:clean package -Dmaven.test.skip=true -Pprod 這種方式就是指定了打包的參數,並且打包后的文件存放到項目的 target 目錄下。