一般情况下,我们都会把本地maven的仓库下载镜像配置成国内的源,试图追求下载速度,然而有时候,在你的IDE里,用maven编译时,会出现这样那样的问题,比如这个:
本地配置阿里云镜像,打包时出现
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…
这个是https安全验证的问题,该怎么搞呢?
是时候使用百度/谷歌了!只要你搜了,肯定有一款适合你的解决方法。
网上提到了下载证书,这里我就不提了,毕竟我安装证书后也没生效😂
最后,我采用直接忽略掉SSL证书检查的方式解决了!
打包
mvn clean package -Dmaven.test.skip -Dmaven.wagon.http.ssl.insecure=true -Dmaven.wagon.http.ssl.allowall=true
编译
mvn clean compile -Dmaven.test.skip -Dmaven.wagon.http.ssl.insecure=true -Dmaven.wagon.http.ssl.allowall=true
安装
mvn clean install -Dmaven.test.skip -Dmaven.wagon.http.ssl.insecure=true -Dmaven.wagon.http.ssl.allowall=true