I am trying to migrate from Java 8 to Java 11. My versions are as follows:
- OpenJDK 11
- Springboot: 2.2.7.RELEASE
- Maven home: 3.6.1
- Lombok: 1.18.12
Everything builds fine. Although I wanted to create a jre using jlink so I need to generate a module-info.java
file. I generated it using the STS ide. I just right click on the project -> Configure -> Create module-info.java
. When I did this, I can't build the project anymore. It throws a cannot find symbol error for the lines of code that calls @Data annotation of Lombok.
I've tried adding the annotationProcessorPaths tags as stated here: solution but it still does not work. I also tried adding the static keyword like this:
but it still does not work.
This is what my pom looks like now:
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<source>11</source>
<target>11</target>
<compilerVersion>11</compilerVersion>
<annotationProcessorPaths>
<annotationProcessorPath>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.12</version>
</annotationProcessorPath>
<path>
<groupId>org.mapstruct</groupId>
<artifactId>mapstruct-processor</artifactId>
<version>1.3.0.Final</version>
</path>
</annotationProcessorPaths>
<compilerArguments>
<AaddGeneratedAnnotation>false</AaddGeneratedAnnotation>
<Adebug>true</Adebug>
</compilerArguments>
</configuration>
</plugin>
I've been searching for the whole day for a solution but I still can't find one that works for me. Any other suggestions that I can try?
Thank you in advance!