SonarQube:无法从服务器获取引导索引:url [http://主机名: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]

查看:378
本文介绍了SonarQube:无法从服务器获取引导索引:url [http://主机名:9095/sonar/batch/index]返回的状态无效:[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.

我还在声纳设置中将基本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://主机名:9095/sonar/batch/index]返回的状态无效:[403]的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆