IntelliJ Idea无法识别Lombok的注释 [英] IntelliJ Idea doesn't recognize Lombok's annotations
问题描述
我正在尝试在IntelliJ IDEA的Maven Java项目中引入Lombok注释,并遵循步骤此处和此处.
I'm trying to introduce Lombok annotations into a Maven Java project in IntelliJ IDEA and followed the steps here and here.
@数据注释(用于一个)未被识别:
@Data annotation (for one) is not being recognized:
以下是相关的Maven节:
Here's the relevant Maven stanza:
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.16.18</version>
</dependency>
</dependencies>
我正在使用Idea 2017.3.2 CE.
I'm on Idea 2017.3.2 CE.
我尝试了此处,则无效:
正在做文件|使缓存无效重新启动没有帮助.
Doing File | Invalidate Caches & Restart didn't help.
我在这里想念什么?
推荐答案
文件" |文件的帮助是什么?项目结构并从Maven添加库(通过在此处搜索org.projectlombok):
What helped was going into File | Project structure and adding a library from Maven (via search for org.projectlombok there):
那将丢失的jar下载到了本地仓库中,我认为这应该由Lombok插件完成.
That downloaded the missing jar into the local repo which I assumed should have been done by the Lombok plugin.
似乎是另一个IntelliJ Idea错误,或者至少是Lombok或IntelliJ插件文档中未明确提及的缺点.我在此处打开了一个问题,也许这可以省去一些麻烦同时转移给其他开发者.
Seems to be yet another IntelliJ Idea bug or at least a shortcoming not clearly mentioned in either Lombok or IntelliJ plugin documentation. I've opened an issue here, perhaps this will save some struggle to other developers in the meantime.
这篇关于IntelliJ Idea无法识别Lombok的注释的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!