【发布时间】:2015-01-15 15:55:17
【问题描述】:
我最近在我的 linux 机器上安装了 Sonarqube-4.5.1 (x86_64 x86_64 x86_64 GNU/Linux)。
我可以使用./sonar.sh start 命令启动声纳。在使用./sonar.sh status 命令检查声纳状态时,它会显示SonarQube is running (18493),但是当我尝试打开仪表板网址http://ip-address:9000 时,它会在浏览器上显示“Connection denied”消息。
在运行mvn sonar:sonar -Dsonar.host.url=http://localhost:9000 命令时出现以下错误:
[ERROR] Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.4:sonar (default-cli) on project app-dao: Execution default-cli of goal org.codehaus.mojo:sonar-maven-plugin:2.4:sonar failed: SonarQube server can not be reached at http://localhost:9000. Please check the parameter 'sonar.host.url'. Connection refused -> [Help 1]
我还尝试了maven connecting to Sonar 中提到的解决方案,并在我的 maven 的 conf/settings.xml 文件中添加了以下条目,但仍然无法解决问题。
<profile>
<id>sonar</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<!-- EXAMPLE FOR MYSQL -->
<sonar.jdbc.username>admin</sonar.jdbc.username>
<sonar.jdbc.password>admin</sonar.jdbc.password>
<sonar.host.url>http://localhost:9000</sonar.host.url>
</properties>
</profile>
【问题讨论】:
-
不清楚 Sonar 是否在另一台机器上运行,而不是您浏览/maven 的机器? Sonar 绑定到哪个 IP?
-
Sonar 和 Maven,都安装在同一台机器上。 “Sonar 绑定到哪个 IP?”我应该如何检查这个。它将是 localhost,因为我没有更新任何默认属性。
-
在 shell 中运行此命令以验证 SonarQube 正在侦听端口 9000:
$ netstat -an | grep 9000