Lombok Maven settings

dependency

<dependency>
 <groupId>org.projectlombok</groupId>
 <artifactId>lombok</artifactId>
 <version>1.16.16</version>
 <optional>true</optional>
</dependency>

plugin

<plugin>
 <groupId>org.projectlombok</groupId>
 <artifactId>lombok-maven-plugin</artifactId>
 <version>1.16.18.0</version>
 <executions>
  <execution>
   <phase>generate-sources</phase>
   <goals>
    <goal>delombok</goal>
   </goals>
   <configuration>
    <outputDirectory>${project.basedir}/src/main/java/</outputDirectory>
   </configuration>
  </execution>
 </executions>
</plugin>

Then, all domain classes goes to src/main/lombok(manually add source folder)
(optional)Eclipse build path ignore pattern for src/main/lombok: **/*.java
If you don’t want to ignore java files in the above folder, Eclipse will complain something like type already exists. It’s ok, because maven won’t pick up the lombok folder unless it’s explicitly set to be included.

This blog may not be up to date. Please see the original post from Blogger http://ift.tt/2tUTzp6
via IFTTT.

Advertisements