Open lwiddershoven opened 3 days ago
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:
<maven.compiler.proc>full</maven.compiler.proc>
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 added to this data class. This is then referenced/used inSomeDataUser
.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.