user204069
user204069

Reputation: 1081

Lombok source not getting generated in build folder, Using Intellij IDEA Community Edition 2019.2.4 and gradle

Lombok source not getting generated in build folder, Using Intellij IDEA Community Edition 2019.2.4 and gradle.

Annotation processing is enabled, and lombok plugin is installed and enabled. I am able to use @Getter @Setter and all other lombok annotation just fine, but when I build the project I don't see Annotated classes generate. enter image description here

enter image description here

Upvotes: 0

Views: 998

Answers (1)

Mark Bramnik
Mark Bramnik

Reputation: 42481

I suspect you're missing the information of how does lombok exactly work.

Let me clarify.

Note that lombok is added as an annotation processor

It runs during the compilation and given the annotated class "alters" the behavior of the java compiler by providing additional bytecode compiled in this class.

So it doesn't generate any sources in the build directory.

However if you have a compiled class that had lombok annotations (like @Getter, @Setter that you've mentioned and others) you can open it with decompiler and see that indeed it has methods (generated by lombok annotation processor).

Sometimes you want to see what was generated by lombok at the level of source file. This is what what "Delombok" does. So you can click on the source code of class annotated with lombok annotations and see if:

Refactor --> Delombok

Upvotes: 1

Related Questions