Setting up Lombok Annotation for Spring Boot Application on Eclipse IDE


As we know that Lombok is an open source java library that automating the boilerplate code generation for any java class. For example, with this annotation processor we don't need to write the getter methods, setter methods and much more.

To find out how to set and use Lombok on the spring boot application, do the following steps:


1. Download and Install Lombok

You can download and find the installation steps in this page.
If you already have installed lombok, follow the next steps.

2. Copy Lombok.jar

The next step after installing lombok is copy or move lombok.jar in to directory where eclipse is installed. Lombok.jar must be copied in ~/Eclipse.app/Contents/MacOS folder.
You need to show package contents of Eclipse.app then copy lombok.jar. 


3. Setting up Eclipse.ini

Don't forget to add this command to eclipse.ini, where is located in ~/Eclipse.app/Eclipse/eclipse.ini

-javaagent:lombok.jar


4. Setting up Eclipse IDE

The last steps is enable the annotation processing in Eclipse IDE.
To enable the annotation processing, open up Eclipse IDE then 
Build Path -> Configure Build Path -> Java Compiler ->Annotation Processing -> choose enable

After enabling the annotations, try to clean the project and check the results.

Both maven project and gradle project, lombok must be add to the compile classpath. 
For example: On maven project, lombok can added to depedency in pom.xml.
For more information about lombok, visit this page.

Thank you, i hope this article help you..

Comments