How to Fix Lombok Issues in IntelliJ IDEA [2025]
Lombok is widely used in Spring Boot projects to reduce boilerplate code with annotations like @Getter
, @Setter
, and @Builder
. However, after updating to the latest version of IntelliJ IDEA and Spring Boot, many developers are encountering Lombok-related issues such as:
❌ Missing Lombok-generated methods (getters, setters, constructors)
❌ Errors related to annotation processing
❌ Compilation failures due to missing Lombok dependencies
The main reason for this issue is that Spring Boot has made Lombok an optional dependency, and IntelliJ IDEA now requires an explicit Lombok version in pom.xml
.
This guide will walk you through how to fix the Lombok issue step-by-step.
Recommended YouTube Video — Step-By-Step Solution
🔍 Why is Lombok Not Working in IntelliJ IDEA?
1️⃣ Lombok is now an optional dependency in Spring Boot — meaning it is not automatically included.
2️⃣ Newer versions of IntelliJ IDEA expect an explicit version for Lombok in pom.xml
.
3️⃣ Annotation processing might be disabled in IntelliJ, preventing Lombok from generating the required methods.
💡 Quick Fix: Add the Explicit Lombok Dependency
To resolve the issue, explicitly add the Lombok dependency in pom.xml
with a specific version:
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.36</version>
<scope>provided</scope>
</dependency>
The <scope>provided</scope>
ensures that Lombok is only needed during compilation and not included in the final build.
By default, it is marked as optional:
Next, also add the Lombok dependency version explicitly to the plugins:
Here is the complete working pom.xml sample code:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.4.1</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.example</groupId>
<artifactId>demo</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>demo</name>
<description>Demo project for Spring Boot</description>
<url/>
<licenses>
<license/>
</licenses>
<developers>
<developer/>
</developers>
<scm>
<connection/>
<developerConnection/>
<tag/>
<url/>
</scm>
<properties>
<java.version>17</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
<!-- https://mvnrepository.com/artifact/org.projectlombok/lombok -->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.36</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<annotationProcessorPaths>
<path>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</path>
</annotationProcessorPaths>
</configuration>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<excludes>
<exclude>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.36</version>
</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
</build>
</project>
🔧 Enable Annotation Processing in IntelliJ IDEA
If annotation processing is disabled in IntelliJ IDEA, Lombok won’t work. Follow these steps to enable it:
1️⃣ Open IntelliJ IDEA
2️⃣ Go to File → Settings → Build, Execution, Deployment → Compiler → Annotation Processors
3️⃣ Check ✅ the box Enable annotation processing
4️⃣ Apply the changes and restart IntelliJ IDEA
🔹 Why is this required?
Lombok relies on annotation processing to generate methods like getters
, setters
, and constructors
. If it is disabled, Lombok annotations won’t work.
Install and Enable the Lombok Plugin in IntelliJ IDEA
Even if Lombok is added correctly, it won’t work unless the Lombok plugin is installed in IntelliJ IDEA.
1️⃣ Open IntelliJ IDEA
2️⃣ Go to File → Settings → Plugins
3️⃣ Search for Lombok
4️⃣ Click Install (if not already installed)
5️⃣ Restart IntelliJ IDEA
🔹 Common Mistake:
Some developers install the plugin but forget to enable it. Always ensure the Lombok plugin is enabled in the settings.
🔧Invalidate IntelliJ Cache and Restart
If Lombok still doesn’t work, IntelliJ’s cache might be causing the problem.
1️⃣ Go to File → Invalidate Caches / Restart
2️⃣ Select Invalidate and Restart
3️⃣ Once IntelliJ IDEA restarts, rebuild the project (Ctrl + Shift + F9
for Windows/Linux, Cmd + Shift + F9
for macOS)
🔹 Why is this needed?
IntelliJ sometimes caches old configurations, and invalidating the cache forces it to reload everything.
🎯 Conclusion
By following these steps, you can easily fix Lombok issues in IntelliJ IDEA (2025) and ensure that your Spring Boot projects work smoothly.
💡 Key Takeaways:
✔ Lombok is now optional in Spring Boot — you must explicitly add it in pom.xml
.
✔ Specify the Lombok version explicitly to prevent IntelliJ errors.
✔ Enable annotation processing in IntelliJ settings.
✔ Install and enable the Lombok plugin in IntelliJ IDEA.
✔ Invalidate cache and restart IntelliJ if issues persist.
If you’re still facing issues, drop a comment below! 🚀