title: Java 8 date/time type `java.time.Instant` not supported by default Issue :
body: <p>I am having a tough time understanding java.time.Instant library. I am not sure where there is not a straightforward solution way to implement Instant library. I have a spring-boot project where I have created RESTful service with CRUD operation on MongoDB. Everything was ok until I introduced Instant updatedOn &amp; Instant createdOn in DTO.</p>
  <p>Here sample code of my POST response where failure is occurring.</p>
  <pre><code>  @Override
    public ResponseEntity&lt;ResponseDto&gt; create(@RequestBody CLMDto CLMDto) {
  
      CLMDto createdCLMDto =
          CLMService.create(CLMDto);
  
      return ResponseEntity.status(HttpStatus.CREATED)
          .header(
              RESPONSE_HEADER_LOCATION, CLM_URL + &quot;/&quot; + createdCLMDto.getId())
          .body(ResponseDto.builder().value(createdCLMDto).build()); //---------------------&gt;**Failing here**
    }
  </code></pre>
  <p>My response DTO looks something like this</p>
  <pre><code>
  @Data
  @Builder
  @JsonInclude(JsonInclude.Include.NON_DEFAULT)
  public class ResponseDto {
  
    private Integer count;
    private Object value;
    private Object error;
    private Object info;
  }
  </code></pre>
  <p>and CLMDto</p>
  <pre><code>@Data
  @Builder
  @NoArgsConstructor
  @AllArgsConstructor
  public class AdminDataDto {
    
    private Instant createdOn;
    private Instant updatedOn;
    @JsonProperty(value = &quot;updatedByName&quot;, access = JsonProperty.Access.READ_ONLY)
    private String updatedByName;
  }
  </code></pre>
  <p>In debugger, i noticed place where exception is happening variable createdCLMDto has following values</p>
  <pre><code>createdOn:Instant@193 &quot;2021-03-27T11:53:24.774765300Z&quot;
  updatedByName:test
  updatedOn:Instant@195 &quot;2021-03-27T11:53:24.774765300Z&quot;
  </code></pre>
  <p>as I am using Lombok plugins so I can't debug inside and find the root cause on autogenerated code. I am not looking for a solution but a suggestion where things can go wrong here. My exact error is</p>
  <pre><code>  Type definition error: [simple type, class java.time.Instant]; nested exception is com.fasterxml.jackson.databind.exc.InvalidDefinitionException: 
  Java 8 date/time type `java.time.Instant` not supported by default: add Module \&quot;com.fasterxml.jackson.datatype:jackson-datatype-jsr310\&quot; to enable 
  handling (through reference chain: 
  com.abc.service.dto.ResponseDto[\&quot;value\&quot;]-&gt;com.abc.dto.AdminDataDto[\&quot;createdOn\&quot;])&quot;,
  </code></pre>
  <p>Needless to say but I already tried the solution provided here to updated maven libraries but no success.
  I find many questions on StackOverflow around this library but no one is explaining the easiest way to implement this libarary.</p>
  <p>I have already following dependency in pom.xml</p>
  <pre><code>        &lt;dependency&gt;
              &lt;groupId&gt;com.fasterxml.jackson.datatype&lt;/groupId&gt;
              &lt;artifactId&gt;jackson-datatype-jsr310&lt;/artifactId&gt;
          &lt;/dependency&gt;
  </code></pre>
  <p>I have already tried the solution provided here
  <a href="https://stackoverflow.com/questions/47120363/java-8-date-time-types-serialized-as-object-with-spring-boot">Java 8 date time types serialized as object with Spring Boot</a></p>