2. Scroll down to the 'Sonar' configuration section and click on 'Add Sonar':
3. Configure your Sonar installation:
The logical name of the server.
Check it if you want to disable this server.
The URL to access your Sonar server (default to http://localhost:9000). This is the URL used when the analysis will be launched by Jenkins.
Server Public URL
This is the URL which the user should use to connect to Sonar. If it's not specified the Server URL will be used.
|Sonar account login||No||If a project cannot be accessed anonymously, the 'Sonar account login' (sonar.login) and 'Sonar account password' (sonar.password) properties are required to run an analysis on this project. These properties have to be set to the credentials of a user having the 'User' role on this project.|
A project cannot be anonymously accessed when either:
It is recommended to create a technical user who has the rights to analyze any projects.
|Sonar account password||No||See Sonar account login.|
The JDBC URL to connect to the database hosting the Sonar database.
The login to connect to the database hosting the Sonar database.
The password to connect to the database hosting the Sonar database (the password will be encrypted in the configuration file).
The Java driver classname to be used to connect to the Sonar database.
Version of sonar-maven-plugin
If you want to force the use of a specific sonar-maven-plugin, you can set it here.
The properties you want to pass to Sonar, you must use the following format: -Dsome.property=some.value -Danother.property=another.value
Skip if triggered by SCM Changes
If you want to skip Sonar analysis when the Jenkins build is launched by a change in the SCM, check it.
Skip if triggered by the build of a dependency
If you want to skip Sonar analysis when the Jenkins build is launched by the build of a dependency, check it.
Skip if environment variable is defined
If this variable is set to true, Sonar analysis will be skipped.
When using trigger exclusions, if you check multiple "Skip if ..." parameters, the build will be skip if at least one of the properties is true (it is an OR condition).
Adding Sonar Runner
2. Scroll down to the 'Sonar Runner' configuration section and click on 'Add Sonar Runner':
3. Click on 'Add Installer' and choose how to install the Sonar Runner, either from:
- An archive file
- An installer that will automatically be downloaded from Codehaus
- By running a command to launch the installer
. It is based on the typical Jenkins tool auto-installation. You can either choose to point to an already installed version of Sonar Runner (uncheck 'Install automatically') or tell Jenkins to grab the installer from a remote location (check 'Install automatically'):