Better Programming

Advice for programmers.

Follow publication

Member-only story

Guide to Lombok With Spring Boot

Yasas Sandeepa
Better Programming
Published in
8 min readMar 1, 2022

Guide to Lombok Cover Image
Image designed by Yasas Sandeepa (The Author)

Imagine you saw a bunch of boilerplate codes in a newly created app and you need to clean it up. If you are aware of Lombok, you will definitely try that out. But beware! You may not know what the consequences are of using that!

So today, I intend to bring you the most important and widely used annotations in Lombok with their limitations. This will give you a clear understanding of how to use Lombok in your project.

For those who are not familiar with project Lombok, I’ll introduce it very shortly.

What Is Lombok?

As per the official docs, “Project Lombok is a java library that automatically plugs into your editor and build tools, spicing up your Java.” It is basically an annotation processor that works at compile-time to add code into your classes.

Why Lombok?

The main advantage of Lombok is it minimizes/removes the boilerplate code and saves the precious time of developers during development. In the best cases, it can replace hundreds of lines of code to only five lines.

It increases the readability of the source code (clean coding) and saves space by reducing lines of code. Also, it can eliminate the misleading logging issues in your application.

How to install

Lombok supports all the major IDEs, such as IntelliJ, Eclipse, Netbeans, and even in VS code. Here I’m using IntelliJ as it is the most widely used IDE for Java. If you want to know how to set up a different IDE, read the official documentation here.

As of IntelliJ version 2020.3, you don’t need to configure the IDE to use Lombok anymore. But for the older version, you need to have the IntelliJ Lombok plugin.

Lombok Plugin in IntelliJ (Image by Author)

You also need to enable annotation processing. In IntelliJ, go to File->Settings->Build, Execution, Deployment->Compiler->Annotation Processors. Select the Enable annotation processing checkbox.

Create an account to read the full story.

The author made this story available to Medium members only.
If you’re new to Medium, create a new account to read this story on us.

Or, continue in mobile web

Already have an account? Sign in

Yasas Sandeepa
Yasas Sandeepa

Written by Yasas Sandeepa

An energetic highly motivated Tech Enthusiastic. First-Class Honours | BSc (Hons) in Information Technology | University of Moratuwa✨Web: bit.ly/yasas4d

No responses yet

Write a response