0

I am using jacoco in my spring boot project. My issues is that compiler generate default constructor and jacoco gives coverage issue for this default constructor, how can I exclude this default constructor from jacoco coverage, I don't want to use @NoArgsConstructor annotation because I have so many classes in which I'm facing this issue and I have to add this @NoArgsConstructor in all those classes one by one. Any better solution there?

I tried @NoArgsConstructor annotation and it solved my issue but I have too many classes so I have to add this in all classes that I don't want

1 Answer 1

1

You should create the lombok.config file in your project root folder adding lombok.addLombokGeneratedAnnotation = true inside it.

So, JaCoCo will ignore (by its design) al the methods annotated by lombok @Generated annotation.

Sign up to request clarification or add additional context in comments.

1 Comment

I tried this but constructor generated by compiler is not ignore by jacoco because constructor is not annotated even using lombok.addLombokGeneratedAnnotation = true

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.