๐Ÿ”ด The Error You're Seeing

Confirm this matches your console output. If it does, you're in the right place.

ERROR LOG[ERROR] COMPILATION ERROR : [ERROR] /path/to/MyClass.java:[10,8] No processor claimed any of the following annotations: lombok.Data, lombok.Builder

โšก Quick Fix Works 80% of the time

Add Lombok to the annotationProcessorPaths in your maven-compiler-plugin configuration.

<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>

๐Ÿง  Why this Happens

Tap to expand the deep technical explanation

In Java 17+, the Maven compiler strictly isolates annotation processors from standard compile dependencies. Even if `lombok` is in your `pom.xml`, Maven ignores it during compilation unless you explicitly declare it inside the `<annotationProcessorPaths>` block of the `maven-compiler-plugin`.

The HITEC City Parking Spot Analogy:

It's like hiring a chef (Lombok) to cook a meal, but forgetting to give them access to the kitchen (annotationProcessorPaths). The manager (Maven) sees ingredients (annotations) but no chef to process them, so it throws an error.

๐Ÿ” How to Reproduce Confirm this is your error

Add `@Data` to a Java class. Add Lombok as a standard dependency in `pom.xml`. Run `mvn clean compile` using Java 17+.

๐Ÿ› ๏ธ Solutions (5 Ways to Fix)

Solution 1โœ“ Most common cause

Configure annotationProcessorPaths in pom.xml

๐Ÿ‘‰ Use this when building with Maven and Java 17+.

Explicitly tell Maven that Lombok is an annotation processor, not just a library.

<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>3.11.0</version> <configuration> <annotationProcessorPaths> <path> <groupId>org.projectlombok</groupId> <artifactId>lombok</artifactId> <version>1.18.30</version> </path> <!-- Add MapStruct here too if using it --> </annotationProcessorPaths> </configuration> </plugin>
Solution 2

Enable Annotation Processing in IntelliJ

๐Ÿ‘‰ Use this if Maven build works, but IntelliJ shows red errors.

IntelliJ has its own compiler. You must manually enable annotation processing in the IDE settings.

// IntelliJ Settings -> Build, Execution, Deployment -> Compiler -> Annotation Processors // Check 'Enable annotation processing'
Solution 3

Install the Lombok Plugin

๐Ÿ‘‰ Use this if you are on an older IntelliJ version that doesn't bundle Lombok.

Modern IntelliJ has Lombok built-in, but older versions require a plugin to understand the annotations.

// IntelliJ Settings -> Plugins -> Search 'Lombok' -> Install -> Restart IDE
Solution 4

Ensure Lombok dependency is not marked as 'provided'

๐Ÿ‘‰ Use this if you see compile errors in the IDE but not in Maven.

Sometimes IDEs fail to index provided scopes. Change to compile scope temporarily to force the IDE to index it, or rely strictly on Maven builds.

<dependency> <groupId>org.projectlombok</groupId> <artifactId>lombok</artifactId> <scope>provided</scope> <!-- This is standard, but IDE needs plugin --> </dependency>
Solution 5

Invalidate Caches and Restart

๐Ÿ‘‰ Use this if everything is configured but the IDE is still stuck.

Sometimes IntelliJ's internal cache gets corrupted and fails to see the Lombok plugin.

// File -> Invalidate Caches... -> Check all boxes -> Invalidate and Restart

๐Ÿ“‹ Version Notes

Spring Boot 2.x

Lombok sometimes worked without explicit annotationProcessorPaths in older Maven versions.

Spring Boot 3.x

Strictly requires explicit annotationProcessorPaths configuration for Java 17+.

๐Ÿ›ก๏ธ How to Prevent This Next Time

Always use Spring Initializr to generate your Spring Boot projects, as it correctly configures the Lombok annotation processor paths automatically.

Course Search
Search across all chapters & stages
๐Ÿ“–

Search the course

Type any topic โ€” branching, stash, rebase, hooks โ€” and jump straight to that chapter.

merge branchesgit stashundo commitrebase