IntelliJ Idea doesn't recognize Lombok's annotations [duplicate]

為{幸葍}努か 提交于 2019-12-08 15:32:07

问题


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:

Here's the relevant Maven stanza:

    <dependency>
        <groupId>org.projectlombok</groupId>
        <artifactId>lombok</artifactId>
        <version>1.16.18</version>
    </dependency>
</dependencies>

I'm on Idea 2017.3.2 CE.

I tried the solution mentioned here, it doesn't work:

Doing File | Invalidate Caches & Restart didn't help.

What am I missing here?


回答1:


What helped was going into File | Project structure and adding a library from Maven (via search for org.projectlombok there):

That downloaded the missing jar into the local repo which I assumed should have been done by the Lombok plugin.

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.



来源:https://stackoverflow.com/questions/48015246/intellij-idea-doesnt-recognize-lomboks-annotations

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!