-
Notifications
You must be signed in to change notification settings - Fork 908
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
Generated Maven project does not process Lombok annotations when compiling with Java 23 #1654
Comments
Thanks for the sample. The problem's occurring because Java 23 disabled automatic discovery of annotation processors from the classpath. As an alternative to declaring annotation processor paths (which requires duplicating the Lombok version), you can set a property instead:
We should probably set this property automatically for projects using Java 23, Maven, and Lombok. |
This is confirmed to work also for me. It does require an up-to-date spring-boot as the maven compiler plugin (provided by Spring Boots' parent) has to be 3.13.0, maybe 3.12.0 but higher than 3.11.0. |
Thanks for the confirmation. Spring Boot 3.3.x and 3.4.x should both be OK at they use 3.13.0 of the compiler plugin by default. Spring Boot 3.2.x and earlier are no longer supported by start.spring.io. |
Example project (reproduction): https://github.com/lwiddershoven/spring-boot-start-lombok-issue
Problem
Lombok-generated methods are not found during maven compilation.
Reproduction
A project is created in
start.spring.io
, using maven and Java 23, with as only dependencyLombok
.Then a normal Java class
SomeData
is added with the Lombok@Data
annotation. One attribute,id
is addedto this data class. This is then referenced/used in
SomeDataUser
.mvn clean verify
will complain:Expectation
I would expect that a freshly generated project with Lombok as a dependency would process annotations as part of the maven build.
Fix
One can add
to the pom file. This enables annotation processing during the build.
The text was updated successfully, but these errors were encountered: