Project Lombok
  • Features
    • Stable
    • Experimental
  • Community
    • Discuss / Help
    • Issues
    • Documentation for contributors
    • Contact the team behind Project Lombok
  • Order / Donate
  • How to use Install
    • Compilers
    • Javac
    • ECJ
    • Build tools
    • maven
    • gradle
    • ant
    • kobalt
    • IDEs
    • Eclipse
    • IntelliJ IDEA
    • Netbeans
    • MyEclipse
    • Spring Tool Suite
    • JBoss Developer Studio
    • Visual Studio Code
    • Platforms
    • Android
    • GWT
  • Download

Maven

To set up lombok with any build tool, you have to specify that the lombok dependency is required to compile your source code, but does not need to be present when running/testing/jarring/otherwise deploying your code. Generally this is called a 'provided' dependency. This page explains how to integrate lombok with the Apache Maven build tool.

Lombok is available in maven central, so telling Maven to download lombok is easy.

Adding lombok to your pom file

To include lombok as a 'provided' dependency, add it to your <dependencies> block like so:

<dependencies>
	<dependency>
		<groupId>org.projectlombok</groupId>
		<artifactId>lombok</artifactId>
		<version>1.18.38</version>
		<scope>provided</scope>
	</dependency>
</dependencies>

You also need to add lombok as an annotation processor. This is mandatory starting with JDK23, or JDK9+ if compiling as modules (you have module-info.java files in your build):

<build>
	<plugins>
		<plugin>
			<groupId>org.apache.maven.plugins</groupId>
			<artifactId>maven-compiler-plugin</artifactId>
			<configuration>
				<annotationProcessorPaths>
					<path>
						<groupId>org.projectlombok</groupId>
						<artifactId>lombok</artifactId>
						<version>1.18.38</version>
					</path>
				</annotationProcessorPaths>
			</configuration>
		</plugin>
	</plugins>
</build>

Eclipse Compiler (ECJ/JDT)

Check out the instructions on the ECJ page.

Delomboking: The Lombok Maven Plugin

There is a plugin for Maven that we recommend you use if you want to delombok via maven. Useful if you want to run source analysis tools on your source after lombok has been applied, or if you want to generate javadoc. The plugin is open source. Read more about the lombok maven plugin.

credits | Copyright © 2009-2025 The Project Lombok Authors, licensed under the MIT license.