Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Manage jacoco-maven-plugin #284

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Manage jacoco-maven-plugin
Add dedicated profile "coverage" to generate separate reports for both
UTs and ITs.

This closes #283
kwin committed Dec 21, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit 930f7cd99d647d8dd2e44e910bac4b98c1952559
52 changes: 52 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -101,6 +101,8 @@ under the License.
<maven.compiler.target>8</maven.compiler.target><!-- use version numbers without the "1." prefix (supported since javac 5) -->
<surefire.version>3.5.2</surefire.version><!-- for surefire, failsafe and surefire-report -->
<assembly.tarLongFileMode>posix</assembly.tarLongFileMode>
<jacoco.append.ut.file>false</jacoco.append.ut.file><!-- set to true to always append for unit test coverage, overwrites default due to https://github.com/jacoco/jacoco/issues/1676 -->
<jacoco.append.it.file>false</jacoco.append.it.file><!-- set to true to always append for integration test coverage, overwrites default due to https://github.com/jacoco/jacoco/issues/1676 -->

<project.build.outputTimestamp>2024-07-04T18:52:57Z</project.build.outputTimestamp>

@@ -135,6 +137,7 @@ under the License.
<version.maven-source-plugin>3.3.1</version.maven-source-plugin>
<version.maven-surefire>${surefire.version}</version.maven-surefire>
<version.maven-war-plugin>3.4.0</version.maven-war-plugin>
<version.jacoco-maven-plugin>0.8.12</version.jacoco-maven-plugin>
</properties>

<repositories>
@@ -346,6 +349,44 @@ under the License.
<artifactId>apache-rat-plugin</artifactId>
<version>${version.apache-rat-plugin}</version>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>${version.jacoco-maven-plugin}</version>
<!-- generate reports for UT and IT coverage separately -->
<executions>
<execution>
<id>default-prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
<configuration>
<append>${jacoco.append.ut.file}</append>
</configuration>
</execution>
<execution>
<id>default-prepare-agent-integration</id>
<goals>
<goal>prepare-agent-integration</goal>
</goals>
<configuration>
<append>${jacoco.append.it.file}</append>
</configuration>
</execution>
<execution>
<id>default-report</id>
<goals>
<goal>report</goal>
</goals>
</execution>
<execution>
<id>default-report-integration</id>
<goals>
<goal>report-integration</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</pluginManagement>
<plugins>
@@ -517,6 +558,17 @@ under the License.
</build>
</profile>
<!-- END SNIPPET: release-profile -->
<profile>
<id>coverage</id>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: allow to activate via property?

<build>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</profile>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add another profile for merged report (for both UTs and ITs)?

<profile>
<id>jdk9+</id>
<activation>