Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Note
titleCode Coverage

Since Java ecosystem 2.2, to get coverage information you have to generate the coverage report. If you are not generating it during your build you can use the following command:

mvn clean org.jacoco:jacoco-maven-plugin:prepare-agent install -Dmaven.test.failure.ignore=true

mvn sonar:sonar

Please check the JaCoCo plugin page for more advanced information

Note
titleUsing Eclipse

Make sure you're not using the Eclipse plugin Maven Embedder (m2eclipse). Define a new Maven runtime pointing to your local Maven install, use the latest Maven Eclipse plugin, m2e, and uncheck "resolve workspace artifacts" in the Maven project launch window.
Have a look at the first comment of this ticket: http://jira.codehaus.org/browse/SONAR-929

Note
titleAdvanced Reactor Options

Note that Advanced Reactor Options (such as "--projects" and "--resume-from") are not supported by SonarQube and should not be used.

 

Configuring the SonarQube Analysis

...

Include Page
Include - Analysis - Security
Include - Analysis - Security

Excluding a module from SonarQube analysis

You can either:

  • use build profiles to exclude some module (like for integration tests)
  • use Advanced Reactor Options (such as "-pl"). For example mvn sonar:sonar -pl !module2

Sample Projects

To help you get started, a simple project sample is available on github that can be browsed or downloadedprojects/languages/java/maven/java-maven-simple

...