Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Exclude class methods from jacoco analysis

Tags:

junit

jacoco

I am looking for a way to exclude specific class methods in my jacoco analysis. I am aware of the "excludes" property but that only applies to entire classes.

In my case i have generated methods that distort the coverage report so i would like to exclude them from the report.

like image 760
Moritz Avatar asked Jan 03 '12 16:01

Moritz


1 Answers

JaCoCo supports now (in 2018, I know the question is from 2012) since version 0.8.0 (released on 2018/01/02) ignoring methods with annotion @lombok.Generated.

So this can be used as a workaround also for other generated methods (if you are able to tag them this way) or even for "hand-written" methods if you really want (although this was probably not the intention of the authors).

like image 70
Mayoares Avatar answered Oct 11 '22 23:10

Mayoares