我需要更改声纳网址而不更改settings.xml,所以我有以下内容:
<plugin>
<groupId>org.sonarsource.scanner.maven</groupId>
<artifactId>sonar-maven-plugin</artifactId>
<version>3.4.1.1168</version>
<configuration>
<sonar.host.url>http://sonar.viavarejo.com.br</sonar.host.url>
</configuration>
</plugin>
我的sonar.host.url无法正常工作,只是忽略即可,看到错误:
[ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.4.1.1168:sonar (default-cli) on project myproject: Unable to execute SonarQube: Fail to get bootstrap index from server: Failed to connect to localhost/0:0:0:0:0:0:0:1:9000: Connection refused (Connection refused) -> [Help 1]
重要:我无法更改settings.xml文件。
答案 0 :(得分:2)
您可以将URL设置为属性:
<properties>
<sonar.host.url>http://<server>:<port>/</sonar.host.url>
</properties>
或直接在命令行usind
mvn sonar:sonar -Dsonar.host.url=http://<server>:<port>/