1

My classes have @builder annotation and in Jacoco code coverage in Jenkins it's creating classname$builder class and it's showing 0% or very less for code coverage. How to ignore those classes in Jenkins?

  • Possible duplicate of [Exclude package from Jacoco coverage in Jenkins](https://stackoverflow.com/questions/53883900/exclude-package-from-jacoco-coverage-in-jenkins) – Godin Apr 08 '19 at 11:10

2 Answers2

0

You could use exclude tag provided by jacoco. Assuming you are using maven you can do the following

            <configuration>
                <excludes>
                    <exclude>**/*builder**</exclude>
                </excludes>
            </configuration>

For more details, check the jacoco report documentation

Yogesh Badke
  • 4,249
  • 2
  • 15
  • 23
0

Following worked for me. No pom changes were required.

Create a file named lombok.config in your directory’s root (where pom is located) and set the following flag in the file:

lombok.addLombokGeneratedAnnotation = true

chepaiytrath
  • 678
  • 1
  • 9
  • 20