Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 24 Next »

Icon

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.
Sonar installation to use.
To manage Sonar installations, see Configuring Sonar Jenkins Plugin.

JDKOptional.
The JDK to use for the Sonar analysis (by default, it is inherited from the job).
Sonar Runner

Mandatory.
Sonar Runner to use to launch the analysis.
To manage Sonar Runners, see Configuring Sonar Jenkins Plugin

Path to project propertiesOptional.
Relative path of the project properties file.

Project properties

Mandatory if 'Path to project properties' is not set.
The properties of the Sonar analysis. The properties defined here will override the ones defined in the project properties file.

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.
Sonar installation to use.
To manage Sonar installations, see Configuring Sonar Jenkins Plugin.

Branch

Optional.
sonar.branch property.
See Analysis Parameters for more information.

Language

Mandatory.
sonar.language property.

MAVEN_OPTS

Optional.
To specify JVM options needed when launching Maven as an external process. See MAVEN_OPTS documentation. Shell-like environment variable expansions work in this field, by using the ${VARIABLE} syntax.

JDKOptional.
The JDK to use for the Sonar analysis (by default, it is inherited from the job).

Additional properties

Optional.
Additional properties can be set. See Analysis Parameters for detailed documentation on these additional properties.

Don't use global triggers configurationIf checked, overrides the default trigger actions set at Sonar installation level.
  • No labels