IntelliJ Idea doesn't recognize Lombok's a

2019-01-29 14:03发布

This question already has an answer here:

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:

enter image description here

enter image description here

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:

enter image description here

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

What am I missing here?

1条回答
女痞
2楼-- · 2019-01-29 15:01

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

enter image description here

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.

查看更多
登录 后发表回答