Usage

Note that Lombok requires Java 6, so an explicit declaration of 1.6 compatibility to the compiler may also be required:

<build>
  <plugins>
    <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-compiler-plugin</artifactId>
      <configuration>
        <compilerVersion>1.6</compilerVersion>
        <source>1.6</source>
        <target>1.6</target>
      </configuration>
    </plugin>
  </plugins>
</build>

Delombok

Add the following to the pom.xml to activate the delombok goal:

<build>
  <plugins>
    <plugin>
      <groupId>org.projectlombok</groupId>
      <artifactId>lombok-maven-plugin</artifactId>
      <version>1.16.18.1</version>
      <executions>
        <execution>
          <phase>generate-sources</phase>
          <goals>
            <goal>delombok</goal>
          </goals>
        </execution>
      </executions>
    </plugin>
  </plugins>
</build>

Place the java source code with lombok annotations in src/main/lombok (instead of src/main/java). During the build process, the src/main/lombok code will be delomboked and the generated java code ends up in target/generated-sources/delombok. The delomboked code is compiled and analysed together with the src/main/java code.