Skip to content

Commit

Permalink
Enforce JaCoCo execution by default with opt-out via jacocoStrict
Browse files Browse the repository at this point in the history
  • Loading branch information
lobaorn committed Feb 15, 2025
1 parent b61e047 commit 2c793b2
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@

<version.bytebuddy>1.15.10</version.bytebuddy>
<version.mockito>4.11.0</version.mockito>
<version.maven-enforcer-plugin>3.5.0</version.maven-enforcer-plugin>
<version.jacoco-maven-plugin>0.8.12</version.jacoco-maven-plugin>
<jacocoStrict>true</jacocoStrict>

<!-- Can not use default, since group id != Java package name here -->
<osgi.export>com.fasterxml.jackson.databind.*;version=${project.version}</osgi.export>
Expand Down Expand Up @@ -85,6 +88,16 @@
<artifactId>byte-buddy-agent</artifactId>
<version>${version.bytebuddy}</version>
</dependency>
<dependency>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>${version.maven-enforcer-plugin}</version>
</dependency>
<dependency>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>${version.jacoco-maven-plugin}</version>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
Expand Down Expand Up @@ -194,6 +207,9 @@
<goals>
<goal>prepare-agent</goal>
</goals>
<configuration>
<propertyName>jacoco.argLine</propertyName>
</configuration>
</execution>
<!-- attached to Maven test phase -->
<execution>
Expand All @@ -215,6 +231,23 @@
<phase>validate</phase>
<goals><goal>enforce</goal></goals>
</execution>
<execution>
<id>enforce-jacoco-exec</id>
<phase>test</phase>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<requireFilesExist>
<files>
<file>${project.build.directory}/jacoco.exec</file>
</files>
</requireFilesExist>
</rules>
<fail>${jacocoStrict}</fail>
</configuration>
</execution>
</executions>
</plugin>

Expand Down

0 comments on commit 2c793b2

Please sign in to comment.