Skip to content

Commit

Permalink
SLING-9775 - Improve JaCoCo code coverage setup
Browse files Browse the repository at this point in the history
* define a project property that provides the JaCoCo agent path
* define default configurations for surefire and failsafe which use
the JaCoCo agent to collect coverage
  • Loading branch information
raducotescu committed Sep 30, 2020
1 parent e0e7eb6 commit 149cc41
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions sling-parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -484,6 +484,9 @@
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<configuration>
<propertyName>jacoco.command</propertyName>
</configuration>
<executions>
<execution>
<id>prepare-agent</id>
Expand Down Expand Up @@ -555,6 +558,27 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<argLine>${jacoco.command}</argLine>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<configuration>
<argLine>${jacoco.command}</argLine>
<systemPropertyVariables>
<!--
for IT where you need a forked JVM to run the tests you can use this system property to make sure that
the JaCoCo agent correctly instruments your code
-->
<jacoco.command>${jacoco.command}</jacoco.command>
</systemPropertyVariables>
</configuration>
</plugin>
</plugins>
</build>
</profile>
Expand Down

0 comments on commit 149cc41

Please sign in to comment.