difference between lombok vs maven-lombok-plugi

Viewed 177

I am unable to find what is the difference between the two artifacts difference (lombok vs maven-lombok-plugin). Is it safe to replace maven-lombok-plugin from the project dependencies with lombok. I could not find enough documentation , can someone please point me in the right direction?

1 Answers

The maven-lombok-plugin is specifically used for Delomboking your classes. You'll still need Lombok as a dependency with the plugin.

How this works is that Lombok itself changes the compilation - when your code is being compiled by javac, Lombok interferes and makes it generate lomboked classes.
You can then Delombok these again using a manual command or the Maven plugin, and that will generate code equivalent to the Lomboked classes. This is useful when you're getting rid of Lombok, for better Javadocs, or for specialized tools like GWT.

In short, you need Lombok to make Lombok work. You need the plugin for the Delombok feature, and nothing else. Delombok can also be triggered manually, you do not need the plugin for it.

Related