sun.security.validator.ValidatorException: PKIX path building failed
maven 的setting 中配置的mirrors 是http,但是aliyun自動跳轉到https,所以需要導入證書
導入過程
1、編譯如下的lnstallCert.java文件 javac lnstallCert.java
2、執行java InstallCert maven.aliyun.com
maven.aliyun.com為apache-maven-3.5.0/conf/settings.xml 中配置的跳轉的路徑
<mirror>
<id>alimaven</id>
<name>aliyun maven</name>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
<mirrorOf>central</mirrorOf>
</mirror>
http://maven.aliyun.com/nexus/content/groups/public/跳轉到
https://maven.aliyun.com/mvn/view
結果
Enter certificate to add to trusted keystore or 'q' to quit: [1]
3.輸入1,然后直接回車,會在相應的目錄下產生一個名為‘jssecacerts’的證書。將證書copy到$JAVA_HOME/jre/lib/security目錄下cp jssecacerts /usr/java/jdk1.8.0_60/jre/lib/security/