Skip to content

[BUG] Using copyJacksonAnnotationsToAccessors=true in Eclipse causes build errors because Jackson tags are duplicated #3946

@erizzo-cfa

Description

@erizzo-cfa

Describe the bug
A project I work on has recently updated to Lombok 1.18.40 and enabled the config option lombok.copyJacksonAnnotationsToAccessors=true. The reason we needed to set that config to true is subtle but has to do with the fact that many of our modules also have lombok.accessors.chain=true (which makes the setters "non-standard" in JavaBeans terms). But I'm not here to discuss that setting - it's required in our context because of backwards compatibility with the enormous number of projects we have to support.

Anyway, there were no problems in either our maven builds or in IntelliJ IDEA. However, in Eclipse (latest release 2025-09, with latest Lombok plugin, v1.18.42) it produces many build errors like this:

Duplicate annotation of non-repeatable type @JsonProperty. Only annotation types marked @Repeatable can be used multiple times at one target.

This seems like a reasonable result, especially when I delombok the code, because the @JsonProperty (and other Jackson annotations, this doesn't only happen with JsonProperty annotation) are present on both the fields and the lombok-generated getters.

What's odd is that it does not cause build problems in IntelliJ or command-line builds with maven. Additionally, our hundreds (maybe thousands) of tests pass just fine, including numerous integration tests that exercise Jackson serialization and deserialization.

To Reproduce
Set up lombok.config with lombok.copyJacksonAnnotationsToAccessors=true.
Create a class like the one below in Eclipse with Lombok plugin installed.

@Data
public class Person {

    @JsonProperty("name")
    private String name;

}

You'll see a build error in the Problems view about the @JsonProperty being repeated.
For example:

Image

Open the same class in IntelliJ and there is no build error. Build it with maven, also no error.

Expected behavior
Behavior should be consistent across maven, IntelliJ, and Eclipse.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions