0

I'm asking and answering my own question, but i'm not assuming i have the best answer. If you have a better one, please post it!

Related Questions:

Here are the symptoms:

  1. I have this compilation error: "Cannot find symbol method getName()" when I try to run the code or when I do "mvn clean install".

  2. If I go to

Refactor -> Lombok or Delombok

all annotations are marked as "readonly"

  1. If I go in any class with Lombok annotations none of them are marked with red underline.

As IDE I use IntelliJ and the project was generated with springinitializr.

I would really appreciate some help.

Robert
  • 186
  • 3
  • 6
  • 16

3 Answers3

3

For IntelliJ:

1) Enable Annotation Processing

File -> Settings -> Build, Execution, Deployment -> Compiler -> Annotation Processors -> Click the checkbox Enable Annotation Processor

2) Install/Update Lombok Plugin (see this)

File -> Settings -> Plugins -> Search for Lombok Plugin -> Update or Install

GnanaJeyam
  • 2,780
  • 16
  • 27
1

Here are the steps:

  1. I updated the lombok plugin version:

File -> Settings -> Plugins -> Updates

  1. Restart IDE.
  2. Download the lombok JAR
  3. Run this command:

mvn install:install-file -DgroupId=org.projectlombok -DartifactId=lombok -Dversion=1.1.18 -Dpackaging=jar -Dfile=/path/to/file

Robert
  • 186
  • 3
  • 6
  • 16
1

add this in dependencies in build.gradle

annotationProcessor "org.projectlombok:lombok:1.18.6"
Aborn Jiang
  • 981
  • 10
  • 9