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 7 Next »

Depending on you are using or not Maven jobs, there are three different methods for activating Sonar analysis.

Activate Sonar analysis on Maven jobs

If your using a Maven jobs, you just need to add a Post-build action on your project :

Then configure it :

Here is the list of properties : 

Properties

Explanation

Branch

Two branches of the same project are considered as different projects in Sonar.

Language

Sets the language of source code. By default, Sonar is using Java source code analysers. If a Sonar plugin allows to analyse another given language, the associated source code analysers can be activated

MAVEN_OPTS

Allow to set the parameters used by Maven such as -Xmx512m

Additional properties

You can add any additional properties here. The properties used by Sonar are described here

You can also override here the default triggers action if the global action does not fit to your project. You will find the same values as in Configure Sonar plugin

Activate Sonar analysis on non-Maven jobs

If you are not using the Maven build process, you can still use this plugin to activate the analysis.

On your project add a Build step :

Then configure it :

The parameters are :

Properties

Explanation

Path to project properties

Relative path of the properties file.

Project properties

Here you can set the properties without the need of the properties file. The values here will overwrite the values defined in the properties file set upper

JVM_OPTIONS

Allow to set the JVM parameters used the Sonar Runner when it will be executed

The properties used by Sonar Runner are the following :

This field allows to pass some configuration parameters to Sonar. Parameters defined here take precedence over the ones potentially defined in the specified sonar-project.properties file. It is even possible to specify all Sonar parameters here and leave the "Path to project properties" input field empty.

Activate Sonar analysis by Ant task

This plugin is useless if you are using the Ant task to define analysis of your projects.
Indeed all the information about the Sonar server will be defined in your Ant build file as explained here

  • No labels