用Lombok创建类后如何修复编译器错误

时间:2019-04-15 10:54:51

标签: java maven intellij-idea lombok intellij-lombok-plugin

我执行了以下步骤:

  • 将Lombok依赖项添加到pom.xml
  • 将Lombok插件添加到Intellij
  • 在Intellij中启用注释处理

我能够在Intellij的“结构”选项卡中看到getter,setter和构造函数。

但是没有任何语法错误。

但是当我尝试编译项目时,它给出了一个错误:


...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

以下是我想在其中使用Lombok的Java类:

@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;

}

我还需要做其他事情吗?

0 个答案:

没有答案