Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

sonar.host.url not working with sonar-maven-plugin:2.7

Tags:

sonarqube

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>

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:\Users\me\.sonar\cache
[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]

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.

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

like image 458
Frank Avatar asked Oct 23 '15 07:10

Frank


People also ask

How do I change my sonar host URL?

Log in to the SonarQube dashboard and click on the “Administration” tab. Browse to the “Configuration -> General settings -> General” menu. Under the “General” section, change the “Server base URL” to the new server domain name. Save the changes.

How do I run a sonar for a local Maven project?

Step1. Download the latest stable release of SonarQube and unzip it to your favorite directory. By default, the SonarQube runs on 9000 port. Now that, SonarQube Server is up and running we are good to integrate our project(Maven)into it and do the continuous inspection of code quality.

What does sonar Maven plugin do?

The SonarScanner for Maven is a Maven plugin that allows you to execute SonarCloud code analysis via a regular Maven goal. As a Maven goal, the scanner is available anywhere Maven is available (locally, in CI services, etc.), without the need to manually download, set up, and maintain a separate installation.


1 Answers

We are investigating the issue. Ticket was created: https://jira.sonarsource.com/browse/MSONAR-129

In the meantime you could either lock the SQ plugin to version 2.6 or pass all properties using command line.

like image 164
Julien H. - SonarSource Team Avatar answered Oct 22 '22 11:10

Julien H. - SonarSource Team