Skip to content

Commit 04f1be8

Browse files
Fix empty JaCoCo aggregate report
The JaCoCo aggregate report was empty because the aggregator POM lacked dependencies on the modules it was supposed to report on. This change introduces a dedicated `org.moreunit.report` module that handles the aggregation by explicitly depending on the core functional modules (`org.moreunit.core`, `org.moreunit`, `org.moreunit.mock`). The aggregate report is still output to the location expected by the CI workflow: `org.moreunit.build/target/site/jacoco-aggregate/jacoco.xml`. Changes: - Created `org.moreunit.report/pom.xml` with coverage aggregation logic. - Registered the new module in `org.moreunit.build/pom.xml`. - Removed the non-functional `report-aggregate` goal from the aggregator POM. Co-authored-by: RoiSoleil <3462260+RoiSoleil@users.noreply.github.com>
1 parent 93d17c7 commit 04f1be8

3 files changed

Lines changed: 63 additions & 12 deletions

File tree

org.moreunit.build/pom.xml

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
<module>../org.moreunit.mock.feature</module>
2121
<module>../org.moreunit.swtbot.test</module>
2222
<module>../org.moreunit.updatesite</module>
23+
<module>../org.moreunit.report</module>
2324
</modules>
2425

2526
<properties>
@@ -305,18 +306,6 @@
305306
<destFile>${project.build.directory}/jacoco-all.exec</destFile>
306307
</configuration>
307308
</execution>
308-
<execution>
309-
<id>report-aggregate</id>
310-
<phase>verify</phase>
311-
<goals>
312-
<goal>report-aggregate</goal>
313-
</goals>
314-
<inherited>false</inherited>
315-
<configuration>
316-
<dataFile>${project.build.directory}/jacoco-all.exec</dataFile>
317-
<outputDirectory>${project.build.directory}/site/jacoco-aggregate</outputDirectory>
318-
</configuration>
319-
</execution>
320309
</executions>
321310
</plugin>
322311
</plugins>

org.moreunit.report/pom.xml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
4+
<modelVersion>4.0.0</modelVersion>
5+
6+
<parent>
7+
<relativePath>../org.moreunit.build/pom.xml</relativePath>
8+
<groupId>org.moreunit</groupId>
9+
<artifactId>moreunit</artifactId>
10+
<version>3.4.1-SNAPSHOT</version>
11+
</parent>
12+
13+
<artifactId>org.moreunit.report</artifactId>
14+
<packaging>pom</packaging>
15+
16+
<name>${project.artifactId}</name>
17+
18+
<profiles>
19+
<profile>
20+
<id>coverage</id>
21+
<dependencies>
22+
<dependency>
23+
<groupId>org.moreunit</groupId>
24+
<artifactId>org.moreunit.core</artifactId>
25+
<version>${project.version}</version>
26+
</dependency>
27+
<dependency>
28+
<groupId>org.moreunit.plugins</groupId>
29+
<artifactId>org.moreunit</artifactId>
30+
<version>${project.version}</version>
31+
</dependency>
32+
<dependency>
33+
<groupId>org.moreunit.plugins</groupId>
34+
<artifactId>org.moreunit.mock</artifactId>
35+
<version>${project.version}</version>
36+
</dependency>
37+
</dependencies>
38+
<build>
39+
<plugins>
40+
<plugin>
41+
<groupId>org.jacoco</groupId>
42+
<artifactId>jacoco-maven-plugin</artifactId>
43+
<executions>
44+
<execution>
45+
<id>report-aggregate</id>
46+
<phase>verify</phase>
47+
<goals>
48+
<goal>report-aggregate</goal>
49+
</goals>
50+
<configuration>
51+
<outputDirectory>${project.basedir}/../org.moreunit.build/target/site/jacoco-aggregate</outputDirectory>
52+
</configuration>
53+
</execution>
54+
</executions>
55+
</plugin>
56+
</plugins>
57+
</build>
58+
</profile>
59+
</profiles>
60+
61+
</project>

org.moreunit.updatesite/pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,5 @@
1515

1616
<name>${project.artifactId}</name>
1717

18+
1819
</project>

0 commit comments

Comments
 (0)