How to prevent JaCoCo from excluding methods annotated with Generated

9 views
Skip to first unread message

Digitek

unread,
Sep 9, 2025, 12:19:49 PM (11 days ago) Sep 9
to JaCoCo and EclEmma Users

Hello,

I’ve noticed that JaCoCo automatically excludes classes and methods annotated with @Generated from code coverage reports.

In my project, however, I use a custom annotation whose name contains "Generated", but it is 100% business/functional. It is not related to code generation. Unfortunately, JaCoCo filters it out just like generated code, even though I want it to be measured by coverage.

Is there a way to configure JaCoCo so that it does not exclude annotations containing "Generated", or to whitelist my specific annotation so that the annotated code is still included in the coverage report?

Thanks in advance for your help!

Best regards,

Marc Hoffmann

unread,
Sep 10, 2025, 2:01:34 PM (10 days ago) Sep 10
to jac...@googlegroups.com
Hi,

that’s a interesting situation. Unfortunately annotations are not configurable.

Best regards,
-marc



--
You received this message because you are subscribed to the Google Groups "JaCoCo and EclEmma Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jacoco+un...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/jacoco/13a5a98c-eb00-42fb-a720-bacc2bb8829dn%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages