Search code examples
jacocolombokjacoco-maven-plugin

JaCoCo: exclude generated methods (using it with Lombok)


I am using JaCoCo and it is considering methods generated by Lombok (generated in the bytecode, not trace of them in the source code). How can I configure JaCoCo to ignore them?


Solution

  • Use the excludes tag provide by jacoco.

                <artifactId>jacoco-maven-plugin</artifactId>
                <version>0.7.4.201502262128</version>
                <configuration>
                    <excludes>
                        <exclude>**/config/**</exclude>
                        <exclude>**/model/**</exclude>
                        <exclude>**/item/**</exclude>
                    </excludes>
                </configuration>