JaCoCo - exclude JSP from report

In Maven reports created by JaCoCo, I get pretty poor coverage because all my compiled JSPs are included (and they are long). I tried the following in reporting :

 <plugin> <groupId>org.jacoco</groupId> <artifactId>jacoco-maven-plugin</artifactId> <configuration> <exclude>target/classes/jsp/**/*.class</exclude> </configuration> </plugin> 

Another similar configuration is in the build POM section for the prepare-package phase. This does not stop the inclusion of JSP classes in the report. How to avoid this?

+9
maven jsp jacoco
Feb 04
source share
1 answer

This is pretty easy. The hint is that the exclude tag already refers to the dir class. So your xml snippet should be:

 <plugin> <groupId>org.jacoco</groupId> <artifactId>jacoco-maven-plugin</artifactId> <configuration> <excludes> <exclude>jsp/**/*.class</exclude> </excludes> </configuration> </plugin> 

Make sure that one exclusion tag in the surrounding element is excluded!

+17
Feb 05 '13 at 9:35 am
source share



All Articles