我正在将sonarQube从旧服务器移至新服务器。
这样做时,我收到以下错误
[ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.5.0.1254:sonar (default-cli) on project ags-probe: Unable to execute SonarQube: 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
我的pom是:
<profile>
<id>sonar-new</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<sonar.host.url>https://newServer.com</sonar.host.url>
<sonar.login>xyz</sonar.login>
<sonar.projectKey>key</sonar.projectKey>
<sonar.projectName>name</sonar.projectName>
</properties>
</profile>
<profile>
<id>sonar-old</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<sonar.host.url>http://oldServer.com</sonar.host.url>
<sonar.login>xyz</sonar.login>
</properties>
</profile>
<profile>
<id>sonar-local</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<sonar.host.url>http://localhost:9000/</sonar.host.url>
</properties>
</profile>
</profiles>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.sonarsource.scanner.maven</groupId>
<artifactId>sonar-maven-plugin</artifactId>
<version>${sonar-maven-plugin.version}</version>
</plugin>
</plugins>
</pluginManagement>
</build>
<properties>
<sonar-maven-plugin.version>3.5.0.1254</sonar-maven-plugin.version>
</properties>
我正在尝试使用sonar-new
上的sonar-old
我正在运行的命令是mvn install sonar::sonar -P artifactory,sonar-new
mvn install sonar::sonar -P artifactory,sonar-old
正常工作。
答案 0 :(得分:0)
您用于新的声纳服务器URL https://newServer.com的证书存在问题。只需导出您在新服务器上拥有的证书的完整证书链即可。然后使用java keytool将证书导入到cacerts文件中:
keytool -import -alias your-certificate-alias -file your-certificate-file -storetype JKS -keystore $JAVA_HOME/lib/security/cacerts -storepass changeit
将$ JAVA_HOME / jre / lib / security / cacerts用于最多8个Java版本。