Jacoco supports excluding generated code from coverage which is annotated with an annotation with simple name containing Generated and retention RUNTIME or CLASS. Using org.hibernate.orm.tooling:hibernate-enhance-maven-plugin multiple $$ methods are generated in the entities but not all those methods are called during our tests causing a negative impact on code coverage. We want to avoid excluding our own classes from code coverage. We also use Lombok in our project which does have a configuration property to add a @Generated annotation allowing us to only measure coverage of "self written" code. The suggestion is to support annotating the generated methods with an annotation like @Generated or @HibernateGenerated in order to avoid affecting code coverage in a negative way. This annotation could also be added conditionally depending on a configuration property like the plugin already does for <enableAssociationManagement>true</enableAssociationManagement> |