1、問題描述
- Maven導入依賴報紅,但是可以正常打包
- 或出現無法找到到請求目標的有效證書路徑:
Could not transfer artifact org.apache.axis:axis:pom:1.4 from/to aliyun (http://maven.aliyun.com/nexus/content/groups/public/): PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
2、解決辦法
- 設置添加依賴忽略ssl 驗證/mvn命令執行時忽略證書檢查步驟如下:
- 在Idea的File–>settings中,設置Maven的importing和Runner參數,忽略證書檢查即可。(Eclipse下解決原理類似,設置maven運行時參數即可)
-Dmaven.wagon.http.ssl.insecure=true -Dmaven.wagon.http.ssl.allowall=true -Dmaven.wagon.http.ssl.ignore.validity.dates=true
- 如果還是不行,嘗試將本地Maven庫對應文件夾刪除後刷新或者選擇重新導入:選擇Maven項目 → Reimport