sonar.host.url 不适用于 sonar-maven-plugin:2.7 [英] sonar.host.url not working with sonar-maven-plugin:2.7

查看:23
本文介绍了sonar.host.url 不适用于 sonar-maven-plugin:2.7的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

将我的 POM 升级到 sonar-maven-plugin:2.7 后,配置不再起作用.我在settings.xml中的配置是这样的:

After upgrading my POMs to sonar-maven-plugin:2.7 the configuration does not work any more. My configuration in settings.xml is like this:

<profile>
  <id>sonar</id>
  <properties>
    <sonar.jdbc.url>jdbc:postgresql://my.server:5432/sonar</sonar.jdbc.url>
    <sonar.jdbc.driverClassName>org.postgresql.Driver</sonar.jdbc.driverClassName>
    <sonar.jdbc.username>xxxxx</sonar.jdbc.username>
    <sonar.jdbc.password>yyyyy</sonar.jdbc.password>
    <sonar.host.url>http://my.server</sonar.host.url>
  </properties>
</profile>

当然,构建是从 -Psonar 开始的.使用 2.6 版一切都很好,使用 2.7 我得到了

The build is started with -Psonar of course. With version 2.6 everything is fine, with 2.7 I get

[INFO] --- sonar-maven-plugin:2.7:sonar (default-cli) @ myproject ---
[INFO] User cache: C:Usersme.sonarcache
[ERROR] SonarQube server 'http://localhost:9000' can not be reached
...
[ERROR] Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.7:sonar (default-cli) on project myproject: Fail to download libraries from server: java.net.ConnectException: Connection refused: connect -> [Help 1]

使用 -X 开始构建在这两种情况下都为我提供了正确的 mojo 配置,尤其是日志中的 url 仍然正确

Starting the build with -X gives me the correct mojo configuration in both cases, especially the url is still correct in the log

[DEBUG]   (f) sonarHostURL = http://my.server

即使删除提到的缓存目录也无济于事.

Even deleting the mentioned caching directory does not help.

除了将插件管理到 2.6 版外,我还能做什么?

What can I do except of managing the plugin to version 2.6?

推荐答案

解决方法:添加 -Dsonar.host.url=http://my.server:9000 到 mvn 命令对我有用

Workaround: Adding -Dsonar.host.url=http://my.server:9000 to mvn command works for me

这篇关于sonar.host.url 不适用于 sonar-maven-plugin:2.7的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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