title: Using lombok with gradle and spring-boot
body: <p>I am trying to build a project with lombok and this is what I have as dependencie. </p>
  
  <pre><code>dependencies {
     compile("org.springframework.boot:spring-boot-starter-thymeleaf")
     compile("org.springframework.social:spring-social-facebook")
     compile("org.springframework.social:spring-social-twitter")
     testCompile("org.springframework.boot:spring-boot-starter-test")
     testCompile("junit:junit")
     compile("org.springframework.boot:spring-boot-devtools")
     compile("org.springframework.boot:spring-boot-starter-data-jpa")
     compile("mysql:mysql-connector-java")
     compileOnly("org.projectlombok:lombok:1.16.10")
  }
  </code></pre>
  
  <p>I am able to include the anotations, and I have included lombok in the editor. I am even able to compile a code using lombok and making a cal to a method generated by lombok.</p>
  
  <p>This is my entity:</p>
  
  <pre><code>@Data
  @Entity
  @Table(name = "TEA_USER", uniqueConstraints = {
      @UniqueConstraint(columnNames = { "USR_EMAIL" }),
      @UniqueConstraint(columnNames = { "USR_NAME" })
  })
  public class User {
  
  
     @NotNull
     @Id
     @GeneratedValue(strategy = GenerationType.AUTO)
     @Column(name="USR_ID")
     private long id;
  
     @NotNull
     @Column(name="USR_FNAME")
     private String firstName;
  
     @NotNull
     @Column(name="USR_LNAME")
     private String lastName;
  
  
     @NotNull
     @Min(5)
     @Max(30)
     @Column(name="USR_NAME")
     private String username;
  
     @Column(name="USR_EMAIL")
     private String email;
  
     @Min(8)
     @NotNull
     @Column(name="USR_PASSWORD")
     private String password;
  }
  </code></pre>
  
  <p>And this is a function that compiles fine:</p>
  
  <pre><code>@PostMapping("/registration/register")
  public String doRegister (@ModelAttribute @Valid User user, BindingResult result){
      user.getEmail();
      System.out.println(user.getFirstName());
      if (result.hasErrors()) {
           return "register/customRegister";
      }
      this.userRepository.save(user);
      return "register/customRegistered";
  }
  </code></pre>
  
  <p>But when I run bootRun and I try to access the funcionality this is the Exception I get:</p>
  
  <pre><code>org.springframework.beans.NotReadablePropertyException: Invalid property 'firstName' of bean class [com.lucasfrossard.entities.User]: Bean property 'firstName' is not readable or has an invalid getter method: Does the return type of the getter match the parameter type of the setter?
  </code></pre>
  
  <p>But, if I manually include the setter and getters, this works fine. I don't get whats going on and how to fix it. Any idea?</p>