1
0
mirror of https://github.com/SAP/jenkins-library.git synced 2025-01-30 05:59:39 +02:00

add JaCoCo code coverage

This commit is contained in:
Christopher Fenner 2018-01-30 21:36:49 +01:00
parent 6fba26acb2
commit 5e2939f1fd

43
pom.xml
View File

@ -159,6 +159,49 @@
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.0</version>
<executions>
<!-- UNIT TESTS -->
<!-- http://www.eclemma.org/jacoco/trunk/doc/maven.html
Default settings
propertyName: argLine
destFile: ${project.build.directory}/jacoco.exec
dataFile: ${project.build.directory}/jacoco.exec
outputDirectory: ${project.reporting.outputDirectory}/jacoco
-->
<!-- Prepares the property pointing to the JaCoCo runtime agent which is passed as VM argument when Maven the Surefire plugin is executed. -->
<execution>
<id>pre-unit-test</id>
<goals><goal>prepare-agent</goal></goals>
</execution>
<!-- Ensures that the code coverage report for unit tests is created after unit tests have been run. -->
<execution>
<id>post-unit-test</id>
<goals><goal>report</goal></goals>
</execution>
<!-- INTEGRATION TESTS -->
<!-- http://www.eclemma.org/jacoco/trunk/doc/maven.html
Default settings
propertyName: argLine
destFile: ${project.build.directory}/jacoco-it.exec
dataFile: ${project.build.directory}/jacoco-it.exec
outputDirectory: ${project.reporting.outputDirectory}/jacoco-it
-->
<!-- Prepares the property pointing to the JaCoCo runtime agent which is passed as VM argument when Maven the Failsafe plugin is executed. -->
<execution>
<id>pre-integration-test</id>
<goals><goal>prepare-agent-integration</goal></goals>
</execution>
<!-- Ensures that the code coverage report for integration tests after integration tests have been run. -->
<execution>
<id>post-integration-test</id>
<goals><goal>report-integration</goal></goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>