unable to find valid certification path to requested target

idea導入gradle工程報錯

A problem occurred configuring root project 'yzf'.
> Could not resolve all artifacts for configuration ':classpath'.
   > Could not resolve org.ow2.asm:asm:7.0-beta.
     Required by:
         project : > com.github.johnrengelman.shadow:com.github.johnrengelman.shadow.gradle.plugin:5.0.0 > com.github.jengelman.gradle.plugins:shadow:5.0.0
      > Could not resolve org.ow2.asm:asm:7.0-beta.
         > Could not get resource 'https://plugins.gradle.org/m2/org/ow2/asm/asm/7.0-beta/asm-7.0-beta.pom'.
            > Could not HEAD 'https://jcenter.bintray.com/org/ow2/asm/asm/7.0-beta/asm-7.0-beta.pom'.
               > sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
 

乍一看是請求缺少證書,對着JDK就是一頓加入證書操作,一度以爲是自己裝了假的JDK

後來在stackoverflow上看到某位大佬說是build.gradle文件中maven的配置url要使用雙引號,一看自己項目裏的url真的是單引號的

改成雙引號重新問題解決,奇怪的是同事用同樣的配置都能正確使用,遂記錄下

發佈了44 篇原創文章 · 獲贊 5 · 訪問量 3萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章