Eclipse Lombok错误

时间:2019-03-22 09:57:57

标签: eclipse lombok

我收到此错误消息:

enter image description here

消息是:

  

edu无法解析为类型

我已将lombok.jar添加到eclipse文件夹中,并且可以检测到它:

enter image description here

有什么想法吗?

1 个答案:

答案 0 :(得分:0)

您的lombok.config最有可能包含以下行:

lombok.extern.findbugs.addSuppressFBWarnings=true

SuppressFBWarnings批注位于 edu .umd.cs.findbugs.annotations中,这就是您收到该错误的原因。

确保documentation中提到的类路径上有findbugs:

Lombok可以添加@SuppressFBWarnings批注,如果 您要在类文件上运行FindBugs。要启用此功能, 确保编译时findbug在类路径上,

似乎您正在使用gradle,因此添加以下内容应该可以:

compile group: 'com.google.code.findbugs', name: 'annotations', version: '3.0.1'

https://mvnrepository.com/artifact/com.google.code.findbugs/annotations/3.0.1#gradle