idea 使用lombok build项目报错 the method getXXX() is undefined for type xxx

记录一下使用lombok过程中遇到的坑。

本次报错是在类上标注@Data后,其他地方引用该对象时能够调用getXXX()方法,代码中不会报错,但是在build项目的时候就不能通过,一直报如下错误:

idea 使用lombok build项目报错 the method getXXX() is undefined for type xxx

idea 使用lombok build项目报错 the method getXXX() is undefined for type xxx

解决办法:

检查编译模式,不能使用Eclipse,修改为Javac再次编译通过。

idea 使用lombok build项目报错 the method getXXX() is undefined for type xxx

lombok插件使用可能还会遇到其他一些问题,如:代码中getXXX()直接报错找不到,排查方式如下:

1、检查pom依赖是否正确,最好直接从mvn repository中拷贝过来。

org.projectlombok lombok 1.18.10 provided 2、插件检查:

idea 使用lombok build项目报错 the method getXXX() is undefined for type xxx

原文链接:https://blog.csdn.net/yangxiaovip/article/details/104864724