maven install 打包 报错 Cannot run program "gpg.exe": CreateProcess error
打包报错,
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 目录下。