maven install报错maven sun.security.validator.ValidatorException: PKIX path building failed

如题,在IDEA中使用maven install操作时,报错:
[ERROR] Plugin org.apache.maven.plugins:maven-resources-plugin:3.0.2 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:3.0.2: Could not transfer artifact org.apache.maven.plugins:maven-resources-plugin:pom:3.0.2 from/to Nexus aliyun (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 -> [Help 1]

查看错误信息,注意加粗部分,通过网上查看文章得知,maven配置了阿里云的远程仓库,在访问阿里云时需要SSL安全证书,而我应该是缺少了SSL安全证书。
解决方法:
①可尝试参考该文章进行操作:https://www.iteye.com/blog/truth99-2160540
②将setting.xml中远程仓库从阿里云换成官方的仓库:


     
    Central   
    http://repo1.maven.org/maven2   
    central
        
  

我是直接在IDEA的maven设置里,把maven home路径从自己安装的Apache-maven路径换成了IDEA自带的maven:Bundled (Maven 3),因为我是在Apache-maven里配置阿里云仓库的,直接在idea中换成自带的比较省事(ಥ_ಥ) 。

本文为个人记录所用,如有侵权/错误,恳请指出 (╹▽╹)…

你可能感兴趣的:(maven)