Adding jacoco report generation and publishing

This commit is contained in:
Joakim Erdfelt 2016-10-19 08:51:45 -07:00
parent f8b2979a8f
commit 91e5fb2ce5
2 changed files with 30 additions and 3 deletions

8
Jenkinsfile vendored
View File

@ -52,7 +52,13 @@ node('linux') {
// Run test phase / ignore test failures
sh "mvn -B install -Dmaven.test.failure.ignore=true"
// Report failures in the jenkins UI
step([$class: 'JUnitResultArchiver', testResults: '**/target/surefire-reports/TEST-*.xml'])
step([$class: 'JUnitResultArchiver',
testResults: '**/target/surefire-reports/TEST-*.xml'])
// Collect up the jacoco execution results
step([$class: 'JacocoPublisher',
execPattern:'target/jacoco*.exec',
classPattern: 'target/classes',
sourcePattern: 'src/main/java'])
}
if(isUnstable())
{

25
pom.xml
View File

@ -171,6 +171,27 @@
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.7.7.201606060606</version>
<executions>
<execution>
<id>jacoco-initialize</id>
<phase>initialize</phase>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>jacoco-site</id>
<phase>package</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-pmd-plugin</artifactId>
@ -270,9 +291,9 @@
<artifactId>maven-surefire-plugin</artifactId>
<version>2.17</version>
<configuration>
<argLine>-showversion -Xmx1g -Xms1g -XX:+PrintGCDetails</argLine>
<argLine>@{argLine} -showversion -Xmx1g -Xms1g -XX:+PrintGCDetails</argLine>
<failIfNoTests>false</failIfNoTests>
<runMode>random</runMode>
<forkCount>1</forkCount>
<systemProperties>
<!--
<property>