龙目岛不适用于Intellij [英] Lombok not working with Intellij

查看:137
本文介绍了龙目岛不适用于Intellij的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法在Intellij中使用任何lombok批注,它在Eclipse中可以正常工作.

I am not able to use any of the lombok annotations in Intellij, it works fine in Eclipse.

到目前为止,我已经做了以下事情:

So far, I have done the following things:

  • 在日食中添加了龙目岛依赖性
  • 安装了lombok插件
  • 启用注释处理

但是,我不能使用任何lombok注释,例如:使用@Builder会导致错误,因为import lombok.Builder不存在.

However, I cannot use any of the lombok annotations, eg: using @Builder gives error because import lombok.Builder does not exists.

我正在使用IDEA 2018.2.1 CE

I am using IDEA 2018.2.1 CE

任何想法,我在做什么错了?

Any ideas, what am I doing wrong?

MVN依赖性:

可以看到已解决依赖关系:

Can see the dependency resolved:

可以看到lombok插件:

Can see the lombok plugin:

启用注释处理:

以下代码给出了错误,基本上我不能使用import lombok,因为某种程度上我的lombok不可用:

Following code gives an error, basically i cannot use import lombok because somehow I lombok is not available:

import lombok.Builder //Error, Cannot resolve Builder

@Builder //Gives error, cannot resolve symbol Builder
public class Employee{
    private int id;
    private String name;
}

推荐答案

从图像中看,您好像拥有子模块temp,这可能是问题
pom.xml用于项目buildertest,而不用于temp

From your images, it seems like you have submodule temp, it can be the problem
The pom.xml is for project buildertest, not temp

如果您想拥有子模块,还应该将其设置为Maven项目并拥有另一个pom.xml

If you want to have submodule, you should also set it as Maven project and have another pom.xml

这篇关于龙目岛不适用于Intellij的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆