Add 'coverage' profile that generates the test coverage report

This commit is contained in:
Trustin Lee 2014-02-08 08:42:03 -08:00
parent bd20f80ca0
commit 71913d3d84
2 changed files with 61 additions and 1 deletions

View File

@ -53,6 +53,46 @@
<quickbuild>false</quickbuild>
</properties>
</profile>
<profile>
<id>coverage</id>
<build>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<executions>
<execution>
<id>jacoco-merge</id>
<phase>prepare-package</phase>
<goals>
<goal>merge</goal>
</goals>
<configuration>
<fileSets>
<fileSet>
<directory>${project.parent.build.directory}/..</directory>
<includes>
<include>**/target/jacoco.exec</include>
</includes>
</fileSet>
</fileSets>
</configuration>
</execution>
<execution>
<id>jacoco-report</id>
<phase>prepare-package</phase>
<goals>
<goal>report</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/jacoco-report</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<dependencies>

22
pom.xml
View File

@ -85,6 +85,26 @@
</test.jvm.argLine>
</properties>
</profile>
<profile>
<id>coverage</id>
<build>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.6.4.201312101107</version>
<executions>
<execution>
<id>jacoco-prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<properties>
@ -448,7 +468,7 @@
<exclude>**/TestUtil*</exclude>
</excludes>
<runOrder>random</runOrder>
<argLine>${test.jvm.argLine}</argLine>
<argLine>${argLine} ${test.jvm.argLine}</argLine>
</configuration>
</plugin>
<!-- always produce osgi bundles -->