编译打包报错
环境
IDEA maven 项目正常打包
控制台运行mvn install -DskipTests
报错问题:
[ERROR] Failed to execute goal on project cad: Could not resolve dependencies for project com.zih:cad:jar:0.0.1-SNAPSHOT: Failed to col
lect dependencies at org.springframework.boot:spring-boot-starter-amqp:jar:2.1.4.RELEASE: Failed to read artifact descriptor for org.sp
ringframework.boot:spring-boot-starter-amqp:jar:2.1.4.RELEASE: Could not transfer artifact org.springframework.boot:spring-boot-starter
-amqp:pom:2.1.4.RELEASE from/to nexus-aliyun (http://maven.aliyun.com/nexus/content/groups/public): Transfer failed for http://maven.al
iyun.com/nexus/content/groups/public/org/springframework/boot/spring-boot-starter-amqp/2.1.4.RELEASE/spring-boot-starter-amqp-2.1.4.REL
EASE.pom: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderExcept
ion: unable to find valid certification path to requested target -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
或者报错
sun.security.validator.ValidatorException: PKIX path building failed
解决办法
修改添加配置信息:
Maven > Runner > VM Options 添加如下内容:
-Dmaven.wagon.http.ssl.insecure=true -Dmaven.wagon.http.ssl.allowall=true
添加该配置,Compile可以正常,但是无法install打包
最终还是maven 配置中镜像链接有问题,最终改成
<mirror>
<id>aliyunmaven</id>
<mirrorOf>central</mirrorOf>
<name>aliyun maven</name>
<url>https://repo1.maven.org/maven2/</url>
</mirror>