Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] lombok.addJavaxGeneratedAnnotation option is not producing the expected annotation #2345

Closed
ramfree17 opened this issue Jan 22, 2020 · 3 comments

Comments

@ramfree17
Copy link

Describe the bug
Using "lombok.addJavaxGeneratedAnnotation = true " is not producing the desired effect of having generated methods have the "@lombok.Generated" annotation. The delomboked files show the annotation is "@java.annotation.Generated("lombok")" instead. This annotation is not propagated to the CLASS so post-test processors like JaCoCo are unable to exclude the generated classes and method from the coverage calculation.

To Reproduce
Attaching a small maven-based project. Invoking "mvn clean test" should produce the following:

  • the delomboked files in the "delomboked" directory
  • the jacoco report in target/site/jacoco/index.html

Expected behavior
All Lombok generated methods should be skipped in the JaCoCo coverage report.

Version info (please complete the following information):

  • Tested with lombok v1.8.10 and lombok-maven-plugin v1.8.10.0
  • javac 1.8.0_201 (Ubuntu) , javac 1.8.0_162 (windows 64-bit)

Additional context
The test cases in the attached zip file has the @test disabled for testing purposes. If those are enabled, only the generated methods for equals, hashCode, toString, and canEqual are not covered since those were not invoked by the included tests.
test-project.zip

@ramfree17
Copy link
Author

Logged this as a bug report as my post in the user forum are still under moderator approval.

@Maaartinus
Copy link
Contributor

@ramfree17 Aren't you confusing addJavaxGeneratedAnnotation with addLombokGeneratedAnnotation? See https://projectlombok.org/features/configuration.

@ramfree17
Copy link
Author

@Maaartinus : yes I definitely am. This is another case of PEBKAC (problem exists between keyboard and chair).

Closing this bug report now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants