"Migrate to Spring Boot 3.2" recipe fails on Lombok Java16 related issue

50 Views Asked by At

Project: Spring Boot 2.7.11, Java11

Lombok dependency as following

compileOnly 'org.projectlombok:lombok:1.18.16'
annotationProcessor 'org.projectlombok:lombok:1.18.16'

Attempting to run: "Migrate to Spring Boot 3.2"

Active java version when running: Java11


The following error (related to Java 16, JEP 396: Strongly Encapsulate JDK Internals by Default) occurs:

Execution failed for task ':compileJava'.
> java.lang.IllegalAccessError: class lombok.javac.apt.LombokProcessor (in unnamed module @0x2fbe1acc) cannot access class com.sun.tools.javac.processing.JavacProcessingEnvironment (in module jdk.compiler) because module jdk.compiler does not export com.sun.tools.javac.processing to unnamed module @0x2fbe1acc

Workaround: first run "Migrate to Java17" recipe (which results in successful upgrade of Lombok) and only then run "Migrate to Spring Boot 3.2".


Is it a bug in OpenRewrite or am I missing something?

0

There are 0 best solutions below