title: Why do my field-based Jackson mixins break when using Lombok @Data?
body: <p>I have a project which uses both <a href="https://github.com/FasterXML/jackson" rel="nofollow noreferrer">Jackson</a> and <a href="https://github.com/rzwitserloot/lombok" rel="nofollow noreferrer">Lombok</a>.  It is using the current latest versions of both (Jackson 2.12.2 &amp; Lombok 1.18.18).  I have the following class containing a Jackson mapped object, with an associated <a href="https://github.com/FasterXML/jackson-docs/wiki/JacksonMixInAnnotations" rel="nofollow noreferrer">Jackson mixin</a>, allowing it to be deserialized either ignoring the given field or not, depending on whether the mixin is passed to the <code>ObjectMapper</code>:</p>
  <pre class="lang-java prettyprint-override"><code>import com.fasterxml.jackson.annotation.JsonProperty;
  import com.fasterxml.jackson.core.JsonProcessingException;
  import com.fasterxml.jackson.databind.json.JsonMapper;
  
  public class IssueDemonstration {
      public static void main(String[] args) throws JsonProcessingException {
          JsonMapper jsonMapper = JsonMapper.builder().build();
          JsonMapper mixinMapper = JsonMapper.builder()
                  .addMixIn(Example.class, ExampleMixin.class).build();
  
          String json = &quot;{\&quot;value\&quot;: \&quot;Some Value\&quot;}&quot;;
          System.out.println(
                  &quot;Default: &quot; + jsonMapper.readValue(json, Example.class).getValue());
          System.out.println(
                  &quot;Mixin: &quot; + mixinMapper.readValue(json, Example.class).getValue());
      }
  
      private static class Example {
          @JsonProperty(access = JsonProperty.Access.READ_ONLY)
          private String value;
  
          public String getValue() {
              return value;
          }
  
          public void setValue(String value) {
              this.value = value;
          }
      }
  
      private abstract static class ExampleMixin {
          @JsonProperty(access = JsonProperty.Access.READ_WRITE)
          private String value;
      }
  }
  </code></pre>
  <p>The above code gives the expected results:</p>
  <pre class="lang-none prettyprint-override"><code>Default: null
  Mixin: Some Value
  </code></pre>
  <p>However, if I change <code>Example</code> to use Lombok's <a href="https://projectlombok.org/features/Data" rel="nofollow noreferrer"><code>@Data</code></a> to automagically generate the getter &amp; setter, the mixin no longer works:</p>
  <pre class="lang-java prettyprint-override"><code>@Data
  private static class Example {
      @JsonProperty(access = JsonProperty.Access.READ_ONLY)
      private String value;
  }
  </code></pre>
  <p>Output:</p>
  <pre class="lang-none prettyprint-override"><code>Default: null
  Mixin: null
  </code></pre>
  <p>Why is this not working when I switch to using <code>@Data</code>?  I see nothing in the Jackson <a href="https://projectlombok.org/features/Data" rel="nofollow noreferrer"><code>@Data</code></a> or <a href="https://projectlombok.org/features/GetterSetter" rel="nofollow noreferrer"><code>@Getter and @Setter</code></a> documentation that indicate that this should behave in this manner.</p>