1

I did the followings steps:

  • Add Lombok Dependency to the pom.xml
  • Add Lombok Plugin to the Intellij
  • Enable Annotation Processing in Intellij

I am able to see getter, setter and constructors in the Intellij in the structure tab.

There isn't any syntax error though.

But when I try to compile project it gives an error:


...new ActivityRatingList(userAccount.accountID, userAccount.name, userAccount.email, e.getTestSetActivityID(), grade.getGradeID(), grade.getGradeName(), e.getDateCreated(), raterAccount.name, e.getStatus(), organizationID)
Error:(392, 0) ajc: The constructor ActivityRatingList(int, String, String, Integer, int, String, Date, String, String, int) is undefined

Following is the java class that I want to use Lombok in:

@AllArgsConstructor
@Getter
@Setter
public class ActivityRatingList {

    private Integer accountID;
    private String userName;
    private String email;
    private Integer activityID;
    private Integer gradeID;
    private String gradeName;
    private Date testDate;
    private String raterAccountName;
    private String progressOfRating;
    private Integer organizationID;

}

Do I need to do something else?

rakakarub
  • 11
  • 2
  • Are you compiling with IntelliJ? – cmoetzing Apr 15 '19 at 11:08
  • yes @cmoetzing , I am compiling with Intellij – rakakarub Apr 15 '19 at 11:13
  • How are you running your example? Is it a `main()` method? – cmoetzing Apr 15 '19 at 12:34
  • No, it is just a part of a class that runs in a server. – rakakarub Apr 15 '19 at 12:36
  • Can it be related to mvn-compiler? – rakakarub Apr 15 '19 at 12:38
  • It really looks like the compiler is not invoking lombok. I just tested your class in Eclipse, IntelliJ and via Maven and everything works fine, including the generated constructor. Please check the compiler settings in your project. – Jan Rieke Apr 15 '19 at 12:41
  • Did you add the annotation processor to mvn? https://stackoverflow.com/questions/28325297/lombok-and-maven – cmoetzing Apr 15 '19 at 12:45
  • Yes, I tried. But it didn't work – rakakarub Apr 15 '19 at 12:51
  • @rakakarub what did not work? Did the maven annotation processor run? Start your `mvn` command in debug mode (`mvn -X`) and see if you find the annotation processing in the command output. All I can say is what you are trying to do works with gradle so it is probably some build setup error. Are you using the newest version of Lombok? What server do you deploy to? – cmoetzing Apr 15 '19 at 14:10

0 Answers0