4

I am not able to use any of the lombok annotations in Intellij, it works fine in Eclipse.

So far, I have done the following things:

  • Added lombok dependency in eclipse
  • Installed the lombok plugin
  • Enabled annotation processing

However, I cannot use any of the lombok annotations, eg: using @Builder gives error because import lombok.Builder does not exists.

I am using IDEA 2018.2.1 CE

Any ideas, what am I doing wrong?

MVN dependency:

Can see the dependency resolved:

Can see the lombok plugin:

Annotation processing enabled:

EDIT:

Following code gives an error, basically i cannot use import lombok because somehow I lombok is not available:

import lombok.Builder //Error, Cannot resolve Builder

@Builder //Gives error, cannot resolve symbol Builder
public class Employee{
    private int id;
    private String name;
}
John Rambo
  • 906
  • 1
  • 17
  • 37
  • In what way can't you use these annotations? You cannot compile the project when you use them, or something else happens? Please, explain this in the question. – Tomasz Linkowski Aug 10 '18 at 16:57
  • @TomaszLinkowski edited, cannot compile because of the compile time error – John Rambo Aug 10 '18 at 17:21
  • OK, so I think that neither annotation processing nor Lombok plugin is responsible for this (they are responsible for the code **generated by** Lombok, and not for the source code of Lombok itself). I see you have included Guava in your sample project. Can you access any of its classes? (I'm trying to determine whether Lombok is the only dependency that you cannot access) – Tomasz Linkowski Aug 10 '18 at 17:56
  • @TomaszLinkowski I just tested it, I am not able to access Guava classes either. – John Rambo Aug 10 '18 at 18:02

1 Answers1

2

From your images, it seems like you have submodule temp, it can be the problem
The pom.xml is for project buildertest, not temp

If you want to have submodule, you should also set it as Maven project and have another pom.xml

BlackPearl
  • 280
  • 2
  • 7