我正在使用Jenkins Kubernetes插件来配置运行Java项目构建管道的不同任务的从属代理(pod)。
其中一个管道阶段包括使用Sonarqube来分析Java代码:
try {
withSonarQubeEnv('SONARQUBE_CFG') {
sh "./mvnw org.sonarsource.scanner.maven:sonar-maven-plugin:3.2:sonar -Dsonar.branch=$branch -Dsonar.verbose=true"
}
} catch (ex) {
ex.printStackTrace()
}
问题是我收到SunCertPathBuilderException,因为它无法验证证书链。
[ERROR] SonarQube server [https://sonarqube.profile.es] can not be reached
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 19.894 s
[INFO] Finished at: 2018-10-11T16:45:10Z
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.2:sonar (default-cli) on project myproject: Unable to execute SonarQube: Fail to download libraries from server: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target -> [Help 1]
我已经在/cfg/keystore.jks
路径的jenkins slave pod中的配置映射中安装了密钥库,但是无法想出一种强制使用该密钥库的方法。想法?
您的问题不是证书错误。您的服务器根本无法访问。