Lombok Not Generating Getters in Spring Boot with MapStruct & Maven (Java 21)
I'm working on a Spring Boot project and facing an issue where Lombok is not generating getters for my entity class. Despite using @Data or @Getter, the getters are missing at compile time, leading to errors like "cannot find symbol getEmail()".
My Setup (Dependencies & Plugins in pom.xml):
3 Replies
⌛
This post has been reserved for your question.
Hey @Patel! Please useTIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here./close
or theClose Post
button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically marked as dormant after 300 minutes of inactivity.
Tried Solutions from GitHub Issues & Community:
✅ Added -proc:full to <compilerArgs> under maven-compiler-plugin
✅ Removed <optional>true</optional> from Lombok dependency
✅ Enabled annotation processing in IntelliJ/Eclipse settings
✅ Checked for conflicting imports of User class
✅ Rebuilt the project using mvn clean install & mvn clean compile
However, Lombok-generated methods are still missing!
💡 Any ideas on what could be causing this issue in my Spring Boot project? 🚀
Hey everyone! I finally figured out why Lombok wasn't generating getters in my Spring Boot project. 🤦♂️
Turns out, I forgot to add Lombok as an annotation processor inside annotationProcessorPaths for MapStruct in maven-compiler-plugin. Adding this fixed it:
Hopefully, this saves someone else the headache! 😅🚀
Post Closed
This post has been closed by <@1046485112902127736>.