本例使用maven进行sonar代码扫描的时候,url 指定的是 https 地址,出现了异常:

Unable to execute SonarScanner analysis: Fail to get bootstrap index from server: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

从错误内容上来看,基本上一眼可以定位到是跟 https 证书有关,于是查找了相关文档。

通过指定参数 ​​-Dmaven.wagon.http.ssl.insecure=true -Dmaven.wagon.http.ssl.allowall=true -Dmaven.wagon.http.ssl.ignore.validity.dates=true​​ 可以跳过证书验证,这样就不会出现错误了。



(END)