SonarQube:无法从服务器获取引导索引:url [http://hostname:9095/sonar/batch/index] 返回的状态无效:[403] [英] SonarQube: Fail to get bootstrap index from server: Status returned by url [http://hostname:9095/sonar/batch/index] is not valid: [403]
问题描述
我正在尝试从 jenkins 作业中执行以下 maven 命令,mvn clean install sonar:sonar -Dsonar.host.url=http://hostname:9095/sonar -Dsonar.projectKey=mavensample -Dsonar.login=admin -Dsonar.password=admin -X
I am trying to execute following maven command from jenkins job,
mvn clean install sonar:sonar -Dsonar.host.url=http://hostname:9095/sonar -Dsonar.projectKey=mavensample -Dsonar.login=admin -Dsonar.password=admin -X
但它失败并出现以下错误,
But it fails with following error,
[DEBUG] 18:20:49.119 Download: http://hostname:9095/batch/index
[ERROR] 18:20:49.176 SonarQube server [http://hostname:9095] can not be reached
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.920 s
[INFO] Finished at: 2017-07-14T18:20:49+02:00
[INFO] Final Memory: 20M/171M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.3.0.603:sonar (default-cli) on project my-stc: Unable to execute SonarQube: Fail to get bootstrap index from server: Status returned by url [http://hostname:9095/batch/index] is not valid: [403] -> [Help 1]
当我尝试在浏览器中访问 http://hostname:9095 时,它可以工作.
When I am trying to access http://hostname:9095 in browser it works.
我还将 sonarqube 设置中的基本 url 设置为 http://hostname:9095 并尝试但它失败了同样的错误.
I have also set the base url in sonarqube settings to http://hostname:9095 and tried but its fails with same error.
Sonaqube 与 maven 和 jenkins 安装在同一台机器上.
Sonaqube is installed on same machine as maven and jenkins.
我认为这可能是由于代理(可能是我错了),所以我在 sonar.properties 文件中设置了代理设置并尝试但没有运气.
I thought it may be due to proxy(may be I am wrong), So I have set proxy settings in sonar.properties file and tried but no luck.
仅供参考,它使用的是以下版本的 sonar-maven 插件,
FYI, It is using following version of sonar-maven plugin,
[INFO] --- sonar-maven-plugin:3.3.0.603:sonar (default-cli) @ my-stc ---
之前有人遇到过同样的问题吗?
Anyone faced same issue earlier ?
推荐答案
问题出在 sonar-maven 插件版本 3.3我尝试了 3.2 版,它工作正常.我将以下内容传递给 maven 命令行参数 org.sonarsource.scanner.maven:sonar-maven-plugin:3.2:sonar
The issue was with sonar-maven plugin version 3.3
I tried with version 3.2 and it worked. I passed following to maven command line arguments org.sonarsource.scanner.maven:sonar-maven-plugin:3.2:sonar
这篇关于SonarQube:无法从服务器获取引导索引:url [http://hostname:9095/sonar/batch/index] 返回的状态无效:[403]的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!