Skip to content

Commit bb95e7b

Browse files
committed
JCR-5173 Create aggregated coverage report
JCR-5172 Exclude jackrabbit-jcr-tests from coverage calculation
1 parent 1b246e6 commit bb95e7b

2 files changed

Lines changed: 50 additions & 0 deletions

File tree

jackrabbit-parent/pom.xml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,39 @@
185185
<properties>
186186
<skip.coverage>false</skip.coverage>
187187
</properties>
188+
<build>
189+
<pluginManagement>
190+
<plugins>
191+
<!-- generates aggregate (cross-module) coverage reports, https://github.com/olamy/jacoco-aggregator-maven-plugin
192+
only enable this plugin (without inheritance) in the root module, as this is an aggregator plugin
193+
-->
194+
<plugin>
195+
<groupId>io.github.olamy.maven.plugins</groupId>
196+
<artifactId>jacoco-aggregator-maven-plugin</artifactId>
197+
<version>1.0.3</version>
198+
<configuration>
199+
<includes>
200+
<!-- exclude shaded 3rd party classes -->
201+
<include>org/apache/jackrabbit/**</include>
202+
</includes>
203+
<excludes>
204+
<!-- exclude classes in jackrabbit-jcr-tests -->
205+
<exclude>org/apache/jackrabbit/test/**</exclude>
206+
</excludes>
207+
</configuration>
208+
<executions>
209+
<execution>
210+
<id>aggregate</id>
211+
<phase>verify</phase>
212+
<goals>
213+
<goal>report-aggregate-all</goal>
214+
</goals>
215+
</execution>
216+
</executions>
217+
</plugin>
218+
</plugins>
219+
</pluginManagement>
220+
</build>
188221
</profile>
189222
</profiles>
190223

pom.xml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,11 @@
3535
<name>Apache Jackrabbit</name>
3636
<packaging>pom</packaging>
3737

38+
<properties>
39+
<!-- this project uses cross-module reports with one aggregate, https://docs.sonarsource.com/sonarcloud/enriching/test-coverage/java-test-coverage/#add-coverage-in-a-multi-module-maven-project -->
40+
<sonar.coverage.jacoco.xmlReportPaths>${project.basedir}/target/site/jacoco-aggregate/jacoco.xml</sonar.coverage.jacoco.xmlReportPaths>
41+
</properties>
42+
3843
<modules>
3944
<module>jackrabbit-parent</module>
4045
<module>jackrabbit-jcr-commons</module>
@@ -87,6 +92,18 @@
8792
</build>
8893

8994
<profiles>
95+
<profile>
96+
<id>coverage</id>
97+
<build>
98+
<plugins>
99+
<plugin>
100+
<groupId>io.github.olamy.maven.plugins</groupId>
101+
<artifactId>jacoco-aggregator-maven-plugin</artifactId>
102+
<inherited>false</inherited><!-- only execute on root level (as aggregator)-->
103+
</plugin>
104+
</plugins>
105+
</build>
106+
</profile>
90107
<profile>
91108
<id>apache-release</id>
92109
<properties>

0 commit comments

Comments
 (0)