PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target


問題截圖:無法找到請求目標的有效證書路徑

 

 

 

 

 

 jar包更新失敗:.lastUpdated

 

報錯信息

Could not resolve archetype org.apache.maven.archetypes:maven-archetype-webapp:1.0 from any of the configured repositories.
Could not resolve artifact org.apache.maven.archetypes:maven-archetype-webapp:pom:1.0
Could not transfer artifact org.apache.maven.archetypes:maven-archetype-webapp:pom:1.0 from/to nexus-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
Could not transfer artifact org.apache.maven.archetypes:maven

 

本人使用的maven版本:3.8.4

 

解決思路1:maven clean -> maven : update preject

解決思路2:重新配置maven

解決思路3:忽略證書 -> 在Eclipse的Maven設置里將Global checksum policy從default設置成ignore就可以關閉這個校驗:

 

 

 

解決思路4:在執行maven命令時忽略證書檢查

在新建maven工程時,會自執行maven的各種命令

在此處設置忽略證書檢查

 

 

 

-Dmaven.wagon.http.ssl.insecure=true -Dmaven.wagon.http.ssl.allowall=true

  

解決思路5:手動導入證書

  • 確保maven中setting文件中的阿里源配置正確 (注意url中協議為https!)
  • 將阿里鏡像庫的證書加到信任證書庫里面
  • 打開上面阿里源的網址
  • https://maven.aliyun.com/nexus/content/groups/public或https://maven.aliyun.com/repository/central都是一樣的
  • 通過chrome瀏覽器下載證書到本地
  • 打開上面阿里源的網址

 

 

 

  • 一路next,將文件命名為ali_maven,后綴默認為.cer,保存到D盤根目錄

  • 通過證書添加到java信任證書庫

 

cacerts包含了很多CA證書,位置在Java的安裝目錄:如: C:\Program Files\Java17\lib\security\carcerts

  

  • 以管理員身份打開命令提示符(cmd)
  • 進入carcerts所在文件目錄
  • 執行命令keytool -import -alias cacerts -keystore cacerts -file d:\ali_maven.cer
  • 默認密鑰庫口令:changeit
  • 是否信任此證書?[否]: Y
  • 顯示證書已添加到密鑰庫中即表示添加成功
  • 回到項目中重新clean,compile,解決

注:以前方案並未解決我的問題,我以為自己把電腦環境搞壞了,又重新裝系統又試了,出現如下問題

儲存庫的鏡像被封

Non-resolvable parent POM for com.beyondsoft.sabg.ImagingBiosen:server:0.0.1-SNAPSHOT: 
 org.springframework.boot:spring-boot-starter-parent:pom:2.4.4 failed to transfer from http://0.0.0.0/ 
 during a previous attempt. This failure was cached in the local repository and resolution is not reattempted 
 until the update interval of maven-default-http-blocker has elapsed or updates are forced. Original error: 
 Could not transfer artifact org.springframework.boot:spring-boot-starter-parent:pom:2.4.4 from/to maven-
 default-http-blocker (http://0.0.0.0/): Blocked mirror for repositories: [maven-default-http-blocker (http://
 0.0.0.0/, default, releases)]

 

最終解決思路6:降低Maven 版本到3.8.1 以下

 

https://blog.csdn.net/hadues/article/details/119038072

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



猜您在找 報錯PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target" maven PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path Maven:sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target 異常解決:sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target 解決 java 使用ssl過程中出現"PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target" nginx中配置wss的websocket報錯:PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target mvn 編譯報錯mavn sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested targ 大坑!maven的web項目初始化錯誤:sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification ... 解決mvn package遇到sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target報錯問題
 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM