Skip to content

Commit

Permalink
[FFM-5247] Fix Jacoco code coverage report (#124)
Browse files Browse the repository at this point in the history
What
Fix the Jacoco code coverage plugin to correctly generate coverage reports. Surefire plugin will stomp over the command line arguments needed by Jacoco and they need to be preserved with some additional configuration.

Why
We want to be able to generate Jacoco code coverage reports so that downstream pipelines can consume coverage information for better reporting

Testing
Confirmed target/jacoco.exec and ./target/site/jacoco/index.html exists after building via cmd line
  • Loading branch information
andybharness authored Nov 25, 2022
1 parent 6526e07 commit 98f8f3e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -398,20 +398,22 @@
<statelessTestsetReporter implementation="org.apache.maven.plugin.surefire.extensions.junit5.JUnit5Xml30StatelessReporter">
<usePhrasedTestCaseMethodName>true</usePhrasedTestCaseMethodName>
</statelessTestsetReporter>
<argLine>${surefireArgLine} -Xmx1024m -noverify</argLine>
</configuration>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.7</version>
<version>0.8.8</version>
<executions>
<execution>
<id>default-prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>report</id>
<id>generate-code-coverage-report</id>
<phase>test</phase>
<goals>
<goal>report</goal>
Expand All @@ -421,6 +423,7 @@
<configuration>
<propertyName>SDK</propertyName>
<propertyName>version</propertyName>
<propertyName>surefireArgLine</propertyName>
</configuration>
</plugin>
</plugins>
Expand Down

0 comments on commit 98f8f3e

Please sign in to comment.