jakartaee / jakartaee/common-annotations-api
Generated scoping issue
- Dominant language
- Java
- Stars
- 67
- Forks
- 42
- PR merge metrics
- No merged PRs in 30d
Description
When using generating JAXB classes using the latest xjc with the -mark-generated argument, it generates the classes with the jakarta.annotation.Generated annotation. I have the generated sources in the build folder, but also have sources in the same package as what xjc generates to, so when using Jacoco I can't exclude solely based on package name. Jacoco can automatically exclude a class from reports if it has a @Generated annotation. Because the current scoping of the annotation is to SOURCE, jacoco doesn't see it and thus includes the classes in the report.
I'll submit a PR, but thought I would create the issue as well for any discussion.
Contributor guide
Research direction
The issue names the jakarta.annotation.Generated annotation, xjc's -mark-generated output, and JaCoCo coverage reports; no source file or test is specified. Start by locating the Generated annotation declaration and its SOURCE scoping, then inspect the existing annotation tests or build checks. Done means generated classes can be excluded by JaCoCo through the annotation without relying on package names.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- build-system, testing
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100