blob: f6c36822e475bc5e4ac7e498d94dcef40c394b3b (
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
|
<#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="JDK9+ with module-info.java">
<p>
The configuration of the compiler plug-in should contain the following:<pre>
<annotationProcessorPaths>
<path>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>${version}</version>
</path>
</annotationProcessorPaths>
</pre>
</p>
</@s.section>
<@s.section title="Eclipse Compiler (ECJ/JDT)">
<p>
Check out the instructions on <a href="/setup/ecj">the ECJ page</a>.
</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>
|