Skip to content

Conversation

mpalourdio
Copy link
Contributor

@mpalourdio mpalourdio commented Sep 26, 2025

Hi,

I am in the process of migrating to JDK 25. But with JDK25, a simple Spring Boot project with maven that uses lombok does not work OOTB.

With JDK 21, this dependency is all we need in a Spring Boot project

<dependency>
  <groupId>org.projectlombok</groupId>
   <artifactId>lombok</artifactId>
  <scope>provided</scope>
</dependency>

From JDK 23+, you need to do either enforce maven compiler like following

<plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-compiler-plugin</artifactId>
      <configuration>
          <annotationProcessorPaths>
              <path>
                  <groupId>org.projectlombok</groupId>
                  <artifactId>lombok</artifactId>
                  <version>1.18.42</version>
              </path>
          </annotationProcessorPaths>
      </configuration>
  </plugin>

Or simply add the following in your <properties>
<maven.compiler.proc>full</maven.compiler.proc>

This PR targets this second option. Hope this is enough, because I am not very used to the pom.xml generation from gradle particularly. Please let me know if this must be put somewhere else in the code base, happy to help.

For reference, here is a lombok issue : projectlombok/lombok#3846

It seems that this parameter has been backport to JDK 11 and more : https://inside.java/2024/06/18/quality-heads-up/ , so this looks safe to me.

Migration to -proc:full

Several measures were undertaken to help projects prepare for the switch to -proc:full:

As of the April 2024 JDK security updates, support for -proc:full has been backported to 17u (17.0.11) and 11u (11.0.23) for both Oracle JDK and OpenJDK distributions. Additionally, Oracle’s 8u release (8u411) also supports -proc:full.

Starting in JDK 21, javac prints an informative message if implicit usage of annotation processing under the default policy is detected.

With -proc:full backported, it is possible to configure a build that will work the same before and after the change in javac’s default policy.

Thanks.

Signed-off-by: Michel Palourdio <mpalourdio@gmail.com>
@wilkinsona
Copy link
Member

Thanks for the suggestion. Unfortunately, I don't think this is something that we should do as it will enable -proc:full for everyone using Spring Boot and Maven, irrespective of whether or not they need it. If -proc:full was a good default for most people, I imagine that it would be javac's default. I think we should respect the fact that it's not and require users to configure it if a dependency that they have chosen to use requires it.

@wilkinsona wilkinsona closed this Sep 26, 2025
@wilkinsona wilkinsona added status: declined A suggestion or change that we don't feel we should currently apply and removed status: waiting-for-triage An issue we've not yet triaged labels Sep 26, 2025
@mpalourdio
Copy link
Contributor Author

Gotcha, just saying it is the default from JDK 11 to JDK 22

full: annotation processing followed by compilation - this policy is the default in JDK ≤22, but the value itself is new (see next section for versions that support it)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: declined A suggestion or change that we don't feel we should currently apply
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants