Skip to content

Instantly share code, notes, and snippets.

@shyiko
Created February 12, 2012 18:06
Show Gist options
  • Save shyiko/1809954 to your computer and use it in GitHub Desktop.
Save shyiko/1809954 to your computer and use it in GitHub Desktop.
Sonar & JaCoCo & Maven 3 integration
<project ...>
...
<properties>
<sonar.core.codeCoveragePlugin>jacoco</sonar.core.codeCoveragePlugin>
<sonar.dynamicAnalysis>reuseReports</sonar.dynamicAnalysis>
<sonar.jacoco.reportPath>${user.dir}/target/jacoco.exec</sonar.jacoco.reportPath>
</properties>
...
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>sonar-maven-plugin</artifactId>
<version>2.0</version>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.5.6.201201232323</version>
<configuration>
<destFile>${session.executionRootDirectory}/target/jacoco.exec</destFile>
</configuration>
<executions>
<execution>
<goals>
<goal>prepare-agent</goal>
</goals>
<phase>initialize</phase>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
@shyiko
Copy link
Author

shyiko commented Feb 12, 2012

mvn clean test sonar:sonar

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment