Lombok Maven Plugin

Project Lombok is an innovative Java library where one can use shorthand to generate code. It has many useful features, such as:

  • Automatic generation of hashCode, equals, and toString methods for a POJO
  • @Data provides functionality similar to a Scala Case Class in Java
  • @Value is similar to @Data, but for immutable classes
  • @Builder is a convenient way to add a Builder pattern to a POJO

Using Lombok can help by:

  • coding faster; short-hand can save writing tons of boilerplate code
  • ensuring correctness; never miss a field in hashCode or equals since they are generated at build time
  • adopting immutability; immutable classes do not require thread synchronization, which can help build scalable solutions
  • being explicit with exceptions; if a field needs to be excluded, one can call that out explicitly

I volunteered to write and maintain the Lombok Maven Plugin, the official Maven Plugin for Project Lombok, because I found value in the project, but did not appreciate that it broke many of the Maven reports. The plugin can run delombok against the source code at build time, translating the short-hand into Java code that can then be processed by other tools, such as JavaDoc, Source Xref, and Unit Testing reports.

This plugin is used by folks all over the world.

Project link: https://awhitford.github.io/lombok.maven/lombok-maven-plugin/

Nifty tech tag lists fromĀ Wouter Beeftink