Search code examples
javaspring-bootlombok

Spring Boot 3 with Lombok


After I upgraded my project from Spring Boot 2.7 to 3.0 I am getting

cannot find symbol

compiler errors because of Lombok generated code.

Is there any way to make it work together - Spring Boot 3 and Lombok annotations.


Solution

  • You should update to the lattest version of lombok 1.18.24 which runs without problems with spring-boot-3.0.1

      <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <version>1.18.24</version>
        </dependency>
    

    Problem is not occuring actually from spring-boot but from jdk since spring-boot-3 requires as minimum jdk17 and older versions of lombok are not compatible with jdk17 or newer.

    As can be seen from changelog lombok 1.18.22 is the first version compatible with jdk17.