我正在尝试为sonarqube进行代码分析。但是,我在运行时遇到错误
mvm声纳:声纳
这是错误消息:
[ERROR] SonarQube server [http://localhost:9000] can not be reached
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 42.972 s
[INFO] Finished at: 2017-06-06T08:51:52+08:00
[INFO] Final Memory: 8M/19M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:
3.3.0.603:sonar (default-cli) on project example-java-maven: Unable to execute SonarQube:
Fail to get bootstrap index from server: Status returned by url
[http://localhost:9000/batch/index] is not valid: [504] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions,
please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
但是当我通过浏览器访问http://localhost:9000时,我可以看到sonarqube主页。
那么为什么会这样呢?
谢谢。
答案 0 :(得分:4)
尝试在你的pom.xml上使用sonar-maven-plugin 3.2版


 < plugin>
 <&的groupId GT; org.sonarsource.scanner.maven< /&的groupId GT;
 < artifactId的>声纳行家-插件< / artifactId的>
 <版本> 3.2< /版本>
 < / plugin>



 这对我有用

答案 1 :(得分:0)
就我而言,我过去在Maven的conf/settings.xml
文件中包含了代理设置。删除或注释掉那些公司代理设置可以解决该问题。