Add jacoco instrumentation for code coverage reports See http://mickaelistria.wordpress.com/2012/10/08/sonar-at-eclipse-org/ Change-Id: Idd7df8125e0792e9bba924eadbc1320230cfa624 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
diff --git a/pom.xml b/pom.xml index d4acb3e..66cc9e0 100644 --- a/pom.xml +++ b/pom.xml
@@ -187,6 +187,11 @@ <jetty-version>7.6.14.v20131031</jetty-version> <clirr-version>2.4</clirr-version> <httpclient-version>4.1.3</httpclient-version> + + <!-- Properties to enable jacoco code coverage analysis --> + <sonar.core.codeCoveragePlugin>jacoco</sonar.core.codeCoveragePlugin> + <sonar.dynamicAnalysis>reuseReports</sonar.dynamicAnalysis> + <sonar.jacoco.reportPath>../target/jacoco.exec</sonar.jacoco.reportPath> </properties> <repositories> @@ -341,6 +346,11 @@ <artifactId>tycho-pack200b-plugin</artifactId> <version>0.18.0</version> </plugin> + <plugin> + <groupId>org.jacoco</groupId> + <artifactId>jacoco-maven-plugin</artifactId> + <version>0.7.0.201403182114</version> + </plugin> </plugins> </pluginManagement> @@ -424,6 +434,27 @@ </execution> </executions> </plugin> + <plugin> + <groupId>org.jacoco</groupId> + <artifactId>jacoco-maven-plugin</artifactId> + <executions> + <execution> + <goals> + <goal>prepare-agent</goal> + </goals> + <configuration> + <destFile>${sonar.jacoco.reportPath}</destFile> + <includes> + <include>org.eclipse.jgit.*</include> + </includes> + <excludes> + <exclude>**/*Test*.*</exclude> + </excludes> + <append>true</append> + </configuration> + </execution> + </executions> + </plugin> </plugins> </build>