忽略Lombok构建警告
警告: Generating equals/hashCode implementation but without a call to superclass, even though this class does not extend java.lang.Object. If this is intentional, add '@EqualsAndHashCode(callSuper=false)' to your type.
- 原因:@Data 自动生成的 equals 和 hashCode 方法未调用父类的实现
- 配置方法:lombok.equalsAndHashCode.callSuper=call
- 解决原理:设置@Data生成的 equals 和 hashCode 方法包含对父类字段的处理
警告: @Builder will ignore the initializing expression entirely. If you want the initializing expression to serve as default, add @Builder.Default. If it is not supposed to be settable during building, make the field final.
- 原因:@Builder 不会给字段进行默认值赋值
- 配置方法:没有配置项,只能在需要的字段上加上 @Builder.Default
- 解决:设置 build 方法赋值字段默认值
lombok.config可以放在项目文件夹外面,比如D盘根目录,这样编译也是生效的