Skip to content

Commit 98f8f3e

Browse files
authored
[FFM-5247] Fix Jacoco code coverage report (#124)
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
1 parent 6526e07 commit 98f8f3e

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

pom.xml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -398,20 +398,22 @@
398398
<statelessTestsetReporter implementation="org.apache.maven.plugin.surefire.extensions.junit5.JUnit5Xml30StatelessReporter">
399399
<usePhrasedTestCaseMethodName>true</usePhrasedTestCaseMethodName>
400400
</statelessTestsetReporter>
401+
<argLine>${surefireArgLine} -Xmx1024m -noverify</argLine>
401402
</configuration>
402403
</plugin>
403404
<plugin>
404405
<groupId>org.jacoco</groupId>
405406
<artifactId>jacoco-maven-plugin</artifactId>
406-
<version>0.8.7</version>
407+
<version>0.8.8</version>
407408
<executions>
408409
<execution>
410+
<id>default-prepare-agent</id>
409411
<goals>
410412
<goal>prepare-agent</goal>
411413
</goals>
412414
</execution>
413415
<execution>
414-
<id>report</id>
416+
<id>generate-code-coverage-report</id>
415417
<phase>test</phase>
416418
<goals>
417419
<goal>report</goal>
@@ -421,6 +423,7 @@
421423
<configuration>
422424
<propertyName>SDK</propertyName>
423425
<propertyName>version</propertyName>
426+
<propertyName>surefireArgLine</propertyName>
424427
</configuration>
425428
</plugin>
426429
</plugins>

0 commit comments

Comments
 (0)