Downloaded Maven Dependencies (BUILD SUCCESS) But Can't Resolve Lombok In IntelliJ

533 Views Asked by At

My project builds successfully with mvn clean install -U, but when building the same project in IntelliJ I get java: package lombok.extern.sl.. does not exist. I have the lombok plugin installed but it can't recognize it. When trying to run test cases by hovering over the class, I see cannot resolve symbol... How do I get IntelliJ to build my project?

2

There are 2 best solutions below

2
Amila On

Check if the Lombok annotation processing is enabled in the IntelliJ compiler settings. Go to Settings -> Build, Execution, Deployment -> Compiler -> Annotation Processors, and make sure that "Enable annotation processing" is checked, and that "Obtain processors from project classpath" is selected.

0
Mar-Z On

Please add following dependency to pom.xml

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