unable to find valid certification path to requested target

错误

  今天对一个项目执行mvn clean install,报错unable to find valid certification path to requested target 。

Could not transfer artifact org.springframework:spring-web:pom:5.0.7.RELEASE from/to alimaven (http://maven.aliyun.com/nexus/content/groups/public/):

sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException:

unable to find valid certification path to requested target

 

分析:

  从提示中看此错误是是缺少网站证书,本机jdk中 没有对应证书,网上有许多方法是下载证书,我试了一下没有解决,

后面找到一种方案是忽略证书,问题解决,所以记录一下供大家参考!

 

解决:

  找到 File -> Settings  -> Build, Execution, Deployment  ->Build Tools  ->Maven  ->Importing

在vm options 中 填上 

-Dmaven.multiModuleProjectDirectory=$MAVEN_HOME
-Dmaven.wagon.http.ssl.insecure=true
-Dmaven.wagon.http.ssl.allowall=true
-Dmaven.wagon.http.ssl.ignore.validity.dates=true

 

如下图: 完美解决

 

posted on 2020-06-13 21:03  爱的宝佑  阅读(1119)  评论(0编辑  收藏  举报