Skip to content

Commit 38df318

Browse files
authored
Added limits to fail the build if coverage is not met for Jacoco Report (#710)
* Added limits to fail the build if coverage is not met for Jacoco Report * Updated
1 parent 413d493 commit 38df318

File tree

1 file changed

+70
-0
lines changed

1 file changed

+70
-0
lines changed

pom.xml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,76 @@
237237

238238
<build>
239239
<plugins>
240+
<plugin>
241+
<groupId>org.jacoco</groupId>
242+
<artifactId>jacoco-maven-plugin</artifactId>
243+
<executions>
244+
<execution>
245+
<id>prepare-agent</id>
246+
<goals>
247+
<goal>prepare-agent</goal>
248+
</goals>
249+
</execution>
250+
<execution>
251+
<id>prepare-agent-it</id>
252+
<goals>
253+
<goal>prepare-agent-integration</goal>
254+
</goals>
255+
</execution>
256+
<execution>
257+
<id>check</id>
258+
<goals>
259+
<goal>check</goal>
260+
</goals>
261+
<configuration>
262+
<rules>
263+
<rule>
264+
<element>BUNDLE</element>
265+
<limits>
266+
<limit>
267+
<counter>INSTRUCTION</counter>
268+
<value>COVEREDRATIO</value>
269+
<minimum>0.70</minimum>
270+
</limit>
271+
<limit>
272+
<counter>BRANCH</counter>
273+
<value>COVEREDRATIO</value>
274+
<minimum>0.50</minimum>
275+
</limit>
276+
<limit>
277+
<counter>COMPLEXITY</counter>
278+
<value>COVEREDRATIO</value>
279+
<minimum>0.50</minimum>
280+
</limit>
281+
<limit>
282+
<counter>LINE</counter>
283+
<value>COVEREDRATIO</value>
284+
<minimum>0.50</minimum>
285+
</limit>
286+
<limit>
287+
<counter>METHOD</counter>
288+
<value>COVEREDRATIO</value>
289+
<minimum>0.80</minimum>
290+
</limit>
291+
<limit>
292+
<counter>CLASS</counter>
293+
<value>COVEREDRATIO</value>
294+
<minimum>0.80</minimum>
295+
</limit>
296+
</limits>
297+
</rule>
298+
</rules>
299+
</configuration>
300+
</execution>
301+
<execution>
302+
<id>report</id>
303+
<phase>test</phase>
304+
<goals>
305+
<goal>report</goal>
306+
</goals>
307+
</execution>
308+
</executions>
309+
</plugin>
240310
<plugin>
241311
<groupId>org.apache.maven.plugins</groupId>
242312
<artifactId>maven-failsafe-plugin</artifactId>

0 commit comments

Comments
 (0)