This page documents how to trigger a Sonar analysis from a Jenkins job for versions 2.0+. For versions prior to 2.0, browse this documentation page. |
| Table of Contents |
Triggering a Sonar Analysis with the Sonar Runner
Go to the 'Build' section, click on 'Add build step' and choose 'Invoke Standalone Sonar Analysis':

Configure the Sonar analysis:

Parameters:
Properties | Description |
|---|---|
| Sonar Installation | Mandatory. |
| JDK | Optional. The JDK to use for the Sonar analysis (by default, it is inherited from the job). |
| Sonar Runner | Mandatory. |
| Path to project properties | Optional. Relative path of the project properties file. |
Project properties | Mandatory if 'Path to project properties' is not set. See Analyzing with Sonar Runner for detailed information on configuring a Sonar analysis with the Sonar Runner. |
| JVM_OPTIONS | The JVM parameters used when executing the Sonar Runner. |
Triggering a Sonar Analysis with Maven
On a Maven job, go to the 'Post-build Actions' section and click on 'Add post-build action':

Then configure this post-build action:
- Choose the 'Sonar Installation':

- Fill in the 'Advanced...' parameters:

Parameters:
Properties | Description |
|---|---|
| Sonar Installation | Mandatory. |
Branch | Optional. |
Language | Mandatory. |
MAVEN_OPTS | Optional. |
| JDK | Optional. The JDK to use for the Sonar analysis (by default, it is inherited from the job). |
Additional properties | Optional. |
| Don't use global triggers configuration | If checked, overrides the default trigger actions set at Sonar installation level. |

