This is my folder structure:
- src
- main
- java
- com.chintan.project
- src-gen
- com.chintan.project
Is there a way to exclude the classes of package com.chintan.project which are present in src-gen folder, from JaCoCo code coverage report.
The output/target directory of both the folders is same, and I cannot change the package structure or the way in which they are compiled and placed in the output/target directory.
I have tried the below JaCoCo configuration but its not working
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.11</version>
<executions>
<execution>
<id>jacoco-prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
<configuration>
<excludes>
<exclude>**/src-gen/**/*</exclude>
</excludes>
</configuration>
</execution>
<execution>
<id>jacoco-report</id>
<phase>test</phase>
<goals>
<goal>report</goal>
</goals>
<configuration>
<excludes>
<exclude>**/src-gen/**/*</exclude>
</excludes>
</configuration>
</execution>
</executions>
</plugin>
Can anyone let me know, where am I going wrong or what can be done to solve this problem.
src-gencontents are generated code, those files shouldn't be inside thesrcfolder. Ref stackoverflow.com/questions/22912900/…target/......