I was using Lombok with JDK8 and everything was working fine. However, when I tried upgrading to JDK17, compilation fails with error
error: cannot find symbol
[ERROR] symbol: class Builder
cannot find symbol
[ERROR] symbol: method getKey()
In my parent pom, I have
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.26</version>
</dependency>
Project structure is :
MainProject
|
-subProject1 --> pom1.xml
-subProject2 --> pom2.xml
-subProject3 --> pom3.xml
|
- Main pom.xml
- lombok.config
The main pom.xml has
<modules>
<module>subProject1</module>
<module>subProject2</module>
<module>subProject3</module>
</modules>
I am getting same issue in Intellij as well as Mac terminal so this issue is not specific to Intellij.
Tried multiple things from internet. Added lombok.addLombokGeneratedAnnotation = true in lombok.config.
Tried <annotationProcessorPaths> in maven-compiler plugin.But nothing is working.I am totally blocked.Kindly suggest.
The configuration in maven-compiler-plugin should look like this. The property
lombok.version(version:It is also important to define the lombok project as a dependency in the modules which really use it like this: