blob: 5ca0912638a34b309844042a82e053d232d6f573 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
<#import "_setup.html" as s>
<@s.scaffold title="Maven">
<@s.introduction>
<p>
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 <a href="https://maven.apache.org/">Apache Maven</a> build tool.
</p><p>
Lombok is available in maven central, so telling Maven to download lombok is easy.
</p>
</@s.introduction>
<@s.section title="Adding lombok to your pom file">
<p>
To include lombok as a 'provided' dependency, add it to your <code><dependencies></code> block like so:<pre>
<dependencies>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>${version}</version>
<scope>provided</scope>
</dependency>
</dependencies>
</pre>
</p>
</@s.section>
<@s.section title="Delomboking: The Lombok Maven Plugin">
<p>
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 <em>after</em> lombok has been applied, or if you want to generate javadoc. The plugin is open source. Read more <a href="http://awhitford.github.io/lombok.maven/lombok-maven-plugin/">about the lombok maven plugin</a>.
</p>
</@s.section>
</@s.scaffold>
|