constructor SomeClass() is already defined in class SomeClass

This is a bug in Lombok 1.6.22; upgrade Lombok to 1.18.0:

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

or, as a work-around, change the order of the annotations:

@NoArgsConstructor
@Data
public class SomeClass {
    private String someProperty;
}

Details:

The root cause of this bug is a bug in Lombok 1.16.22. Spring Boot 1.5.13 uses Lombok 1.16.20 which does not have this bug, but Spring Boot 1.5.14 updated the Lombok dependency to 1.16.22 -- unfortunately, the Lombok project does not comply with SEMVER which then triggered this bug.


I was facing this issue even on the most recent version i.e.

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

After marking my member variables as final everything worked.

@RequiredArgsConstructor generates a constructor with the required arguments, where a required arguments are final fields and fields annotated with @NonNull (more on that later)