Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Infoiframe
iconframeborderfalse0
titleheightTable of Contents10

Table of Contents
maxLevel2

It is recommended to run project analysis on a regular basis to get the best from the Sonar platform. Continuous Integration servers are the perfect tools to do so.

Hudson / Jenkins

Install and configure the Sonar plugin for Hudson / Jenkins.

Atlassian Bamboo

Install the Sonar plugins for Bamboo, by Marvelution.

Apache Continuum 1.2

...

Code Block
mvn clean install sonar:sonar -Dmaven.test.failure.ignore=true
Note

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:
Code Block
sonar:sonar

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

CruiseControl

...

Code Block
clean install -Dtest=false -DfailIfNoTests=false | sonar:sonar -Psonar_profile

Jetbrains 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

    No Format
    clean install sonar:sonar
    

    Additional maven command line parameters:

    No Format
    -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'
srchttp://redirect.sonarsource.com/doc/continuous-integration.html

Documentation has been moved to http://redirect.sonarsource.com/doc/continuous-integration.html.

Documentation has been moved to http://redirect.sonarsource.com/doc/continuous-integration.html.