Kamil Szuster
Kamil Szuster

Reputation: 205

SonarQube - Jenkins - Maven - without running instance

I am running my analysis with Maven, triggered by a Jenkins job. As a DBMS i am using MySQL thats running on the same server as Jenkins does but my sonar instance is running on my local machine (connected to the MySQL DB). I don't want to run it on the server, yet. I would prefer to not run it at all for the time being.

Is it possible to run the analysis without a running sonar instance? Why do I have to configure the server URL (the login too) in both, the Jenkins plugin and the pom.xml?

The described architecture on SonarQube Platform Overview indicates that the analyser and server are not directly connected (only via DB).

When i try to run the analysis from Jenkins with no Server URI the build process is throwing the following message:

[ERROR] Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.2:sonar (default-cli) on project xxx: SonarQube server can not be reached at http://localhost:9000. Please check the parameter 'sonar.host.url'. Connection refused -> [Help 1]

Thats exactly what i expected, he is trying to connect to the SonarQube instance that i did not want to run.

Upvotes: 0

Views: 624

Answers (1)

HJW
HJW

Reputation: 23443

You don't have to configure the URL to Sonar in the POM if you are using the Sonar plugin to push results to Sonar.

Sonar 'instance' you are referring to is for you to visually see the post code analysis result. If you don't have the Sonar UI web application installed, code analysis is still run by Maven either through Jenkins or your IDE or in the command prompt/shell.

Upvotes: 0

Related Questions