Full documentation for SonarQube has moved to a new location: http://docs.sonarqube.org/display/SONAR

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

Continuous integration engines

It is recommended to run the data collect on a regular basis to get the best from the Sonar platform. Continuous Integration engines are the perfect tool to do so.

Continuum 1.2

The difficulty in Continuum is to be able to synchronize an install goal with the sonar goal because it is necessary that an install command is run before the sonar collect starts (See Analyzing Java Projects for more information).

Since Continuum does not provide mechanism to trigger a build from a build, there 2 options : either running install commands regularly (for example every hour), or trigger a complete command such as :

Icon

in this case, unit test are going to be run twice : once during install and once during sonar

In case you decide to run install commands regularly, here is the setup you can do for the sonar build :

  • Create a build definition with the goal :

For multi-module projects, make sure that the --non-recursive build definition argument is NOT set.

  • Once created, run this build definition on the root pom of the projects you want to sonar.
  • For multi-module projects, make sure to check For multi modules project, load only root as recursive build when you create the project through the Continuum maven 2 wizard 

Hudson

Start by installing and configuring the Sonar plugin for Hudson

For Maven projects

Create a new project



In the project configuration, under the Build section



In the post-build section



Save and you are done.

For non maven projects


Create a new project



In the post-build section



Save and you are done.

CruiseControl


In CruiseControl, use the | to run the install and the sonar in two different processes.

The command to be launched should look like :

TeamCity

These are the build configuration steps you need to do for the build:

  1. In general settings, make sure that fail build if at least one test failed is unchecked.
  2. In build runner config, select Maven2, with the goal
    clean install sonar:sonar
    
    Additional maven command line parameters:
    -Dmaven.test.failure.ignore=true
    
  3. In build triggering select a daily schedule (or what you prefer).
  4. In Properties and environment variables, add an environment variable called MAVEN_OPTS, and set the value to '-Xmx512m'
  • No labels