-
Notifications
You must be signed in to change notification settings - Fork 41k
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
Duplicate properties in the meta-data with lombok #8886
Comments
I created another testcase showcasing the issue at /~https://github.com/AlexFalappa/spring-boot-testcase2. The problem could not depend on the presence of an inner class. @zhanhb, from my experiments a workaround is to make sure the |
In our STS environment this problem causes a "Save Problem" popup every time an @ConfigurationProperties is modified and saved.
@AlexFalappa The suggested workaround does not seem to work in our project |
@bluebilt then something more involved is going on in the |
Looks like Lombok is quite painful in this scenario, see this stackoverflow thread What happens here is that lombok has already ran and has generated the thing that we are auto-detecting ourselves. So we first create a property because the getter/setter is there and then we check if lombok types are set somewhere (they are). And we generate the property again. It would be so much easier if we could guarantee that lombok has to run first. That way, all the lombok specific code in our codebase could go away. Unfortunately, that does not seem to be possible. |
@bluebilt please report this issue in the STS tracker. Adding the logs and what you are doing should help. |
@snicoll you may want to have a look at this MapStruct issue where they faced and solved a similar issue. At this comment one of the lombok developer seem to explain why the annotation processors dependency order in the pom.xml apparently avoids the problem. After that MapStruct's @gunnarmorling references a SPI made in collaboration with lombok devels to solve the issue. Hope it helps |
@AlexFalappa thanks. I have a "fix", about to push. |
Get more than one statement in META-INF/spring-configuration-metadata.json when Annotate ConfigurationProperties class with lombok.Getter lombok.Setter
Here is a test project
/~https://github.com/zhanhb/configuration-processor-lombok-test
The text was updated successfully, but these errors were encountered: