Lombok is Rebel and Rebel supports Lombok!

1. Overview

It has been a while since project Lombok entered the vibrant world of Java. While it may not be a part of every Java project, it offers many advantages and has probably even influenced some changes in Java itself.

Lombok and Rebel share many similarities. Both of them aim towards making software development less verbose. Both of them use declarative programming constructs. Both of them generate Java code. Finally, both of them reduce the amount of repetitive code you have to write.

Since version 2.4.0, Rebel generates Lombok annotations instead of getters and setters by default.

2. Maven Dependencies

To use Lombok in the project, we will add Lombok Maven (or Gradle) dependency to the build:

<dependency>
     <groupId> org.projectlombok </groupId>
     <artifactId >lombok </artifactId>
     <version>1.18.16</version >
     <scope>provided</scope >
</dependency>

3. Lombok Configuration

To turn off Lombok annotations and use getters and setters, switch Lombok toggle off in Rebel configuration, as shown in the picture below.

Rebel configuration: Lombok
Lombok configuration

To instruct Lombok to create chained setters for you, simply include file named lombok.config with the following line in the root package of your project: lombok.chainedSetters=true.

This gives you the possibility to chain setter invocation for the generated classes. For instance, you can write:
Person p = new Person().setFirstName("John").setLastName("Doe");

4. Project Export

From time to time, we hear people complaining about preserve sections generated by Rebel.

To export your project to a new codebase, without any preserve sections, use the Export option from the Rebel menu. You will be prompted to select a destination directory for your new codebase.

5. Summary

Rebel release 2.4.0 brings some exciting features, Lombok and Project Export being the most significant of them.

Give it a try and let us know if you like it: your feedback truly counts!

Great work provides a great integrity.