Add 'Generated' annotation to allow coverage exclusion by Jacoco

Description

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>

Environment

None

Assignee

Unassigned

Reporter

Rob Van Looke

Fix versions

None

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

Affirmative

Pull Request

None

backportDecision

None

Components

Affects versions

Priority

Major
Configure