Skip to content
Permalink
Browse files
[FIXED JENKINS-45546] Add jacoco code coverage to Declarative builds
Note that we're not using the Jacoco plugin - it's not installed on
ci.jenkins.io in the first place, and I think the real value is
probably going to come from the XML file anyway, which can be slurped
in by other tools.
  • Loading branch information
abayer committed Jul 18, 2017
1 parent 6c65ef8 commit 39a51eff283e826e4065c660d49b043e2b0f153e
Showing with 41 additions and 0 deletions.
  1. +2 −0 Jenkinsfile
  2. +39 −0 pom.xml
@@ -35,9 +35,11 @@ pipeline {
}
success {
archive "**/target/*.hpi"
archive "**/target/site/jacoco/jacoco.xml"
}
unstable {
archive "**/target/*.hpi"
archive "**/target/site/jacoco/jacoco.xml"
}
}

39 pom.xml
@@ -257,6 +257,45 @@
<tagNameFormat>pipeline-model-definition-@{project.version}</tagNameFormat>
</configuration>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.7.9</version>
<executions>
<execution>
<id>prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>report</id>
<phase>prepare-package</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
<execution>
<id>post-unit-test</id>
<phase>test</phase>
<goals>
<goal>report</goal>
</goals>
<configuration>
<!-- Sets the path to the file which contains the execution data. -->

<dataFile>target/jacoco.exec</dataFile>
<!-- Sets the output directory for the code coverage report. -->
<outputDirectory>target/jacoco-ut</outputDirectory>
</configuration>
</execution>
</executions>
<configuration>
<systemPropertyVariables>
<jacoco-agent.destfile>target/jacoco.exec</jacoco-agent.destfile>
</systemPropertyVariables>
</configuration>
</plugin>
</plugins>
</build>

0 comments on commit 39a51ef

Please sign in to comment.