Skip to content

Commit 40cf3b1

Browse files
Adding JaCoCo
1 parent 9b8e315 commit 40cf3b1

File tree

3 files changed

+100
-0
lines changed

3 files changed

+100
-0
lines changed

coverage/pom.xml

+68
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<modelVersion>4.0.0</modelVersion>
6+
7+
<!-- From https://cylab.be/blog/97/compute-code-coverage-for-a-multi-module-maven-project-with-jacoco -->
8+
9+
<parent>
10+
<groupId>org.hjug.refactorfirst</groupId>
11+
<artifactId>refactor-first</artifactId>
12+
<version>0.1.2-SNAPSHOT</version>
13+
</parent>
14+
15+
<artifactId>coverage</artifactId>
16+
17+
<description>Compute aggregated test code coverage</description>
18+
19+
<properties>
20+
<maven.deploy.skip>true</maven.deploy.skip>
21+
</properties>
22+
23+
<dependencies>
24+
<dependency>
25+
<groupId>org.hjug.refactorfirst.changepronenessranker</groupId>
26+
<artifactId>change-proneness-ranker</artifactId>
27+
</dependency>
28+
29+
<dependency>
30+
<groupId>org.hjug.refactorfirst.effortranker</groupId>
31+
<artifactId>effort-ranker</artifactId>
32+
</dependency>
33+
34+
<dependency>
35+
<groupId>org.hjug.refactorfirst.costbenefitcalculator</groupId>
36+
<artifactId>cost-benefit-calculator</artifactId>
37+
</dependency>
38+
39+
<dependency>
40+
<groupId>org.hjug.refactorfirst.graphdatagenerator</groupId>
41+
<artifactId>graph-data-generator</artifactId>
42+
</dependency>
43+
44+
<dependency>
45+
<groupId>org.hjug.refactorfirst.plugin</groupId>
46+
<artifactId>refactor-first-maven-plugin</artifactId>
47+
</dependency>
48+
</dependencies>
49+
50+
<build>
51+
<plugins>
52+
<plugin>
53+
<groupId>org.jacoco</groupId>
54+
<artifactId>jacoco-maven-plugin</artifactId>
55+
<version>0.8.6</version>
56+
<executions>
57+
<execution>
58+
<id>report-aggregate</id>
59+
<phase>verify</phase>
60+
<goals>
61+
<goal>report-aggregate</goal>
62+
</goals>
63+
</execution>
64+
</executions>
65+
</plugin>
66+
</plugins>
67+
</build>
68+
</project>

lombok.config

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
lombok.addLombokGeneratedAnnotation = true

pom.xml

+31
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@
8787
<module>graph-data-generator</module>
8888
<module>refactor-first-maven-plugin</module>
8989
<module>refactor-first-gradle-plugin</module>
90+
<module>coverage</module>
9091
</modules>
9192

9293
<dependencyManagement>
@@ -115,6 +116,12 @@
115116
<version>${project.version}</version>
116117
</dependency>
117118

119+
<dependency>
120+
<groupId>org.hjug.refactorfirst.plugin</groupId>
121+
<artifactId>refactor-first-maven-plugin</artifactId>
122+
<version>${project.version}</version>
123+
</dependency>
124+
118125
<dependency>
119126
<groupId>org.hjug.refactorfirst.testresources</groupId>
120127
<artifactId>test-resources</artifactId>
@@ -216,6 +223,30 @@
216223
</configuration>
217224
</plugin>
218225

226+
<plugin>
227+
<groupId>org.jacoco</groupId>
228+
<artifactId>jacoco-maven-plugin</artifactId>
229+
<version>0.8.6</version>
230+
<executions>
231+
<!-- to avoid bugs in some situations -->
232+
<execution>
233+
<id>default-prepare-agent</id>
234+
<goals>
235+
<goal>prepare-agent</goal>
236+
</goals>
237+
</execution>
238+
239+
<!-- create report during maven verify phase -->
240+
<execution>
241+
<id>report</id>
242+
<phase>verify</phase>
243+
<goals>
244+
<goal>report</goal>
245+
</goals>
246+
</execution>
247+
</executions>
248+
</plugin>
249+
219250
<!-- From https://mkyong.com/maven/mvn-site-java-lang-classnotfoundexception-org-apache-maven-doxia-siterenderer-documentcontent/-->
220251
<!--Needed to allow mvn site to work-->
221252
<plugin>

0 commit comments

Comments
 (0)