如何解决:IntelliJ中似乎无法识别Lombok builder()方法? [英] How to fix: Lombok builder() method does not seem to be recognised in IntelliJ?

查看:86
本文介绍了如何解决:IntelliJ中似乎无法识别Lombok builder()方法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不确定我在做什么错.有人可以帮帮我吗

POM:

实施:

使用如下:

似乎无法识别builder()方法.我正在使用IntelliJ.有什么我想念的吗?

以下是我的智能设置:

解决方案

除了提供的范围中的依赖项之外,您还必须启用注释处理(如果使用的是IntelliJ Idea)并安装

  • Lombok插件:导航至 File ->设置->插件,并确保已安装Lombok插件.

  • 重新启动IntelliJ Idea-最有可能错过的部分:)

  • I am not sure what am I doing wrong. Can somebody please help me out

    POM:

    Implementation:

    Using it as below:

    The builder() method does not seem to be recognised. I am using IntelliJ. Is there something that I am missing?

    Below are my intelliJ settings:

    解决方案

    Aside from the dependency in the provided scope you have to enable the annotation processing (if you are using IntelliJ Idea) and install the Lombok Plugin.

    1. <dependency>
          <groupId>org.projectlombok</groupId>
          <artifactId>lombok</artifactId>
          <version>${lombok.version}</version>
          <scope>provided</scope>
      </dependency>
      

    2. Annotation processing: Navigate to File -> Settings -> Build, Execution, Deployment -> Compiler -> Annotation Processors and check Enable annotation processing.

    3. Lombok Plugin: Navigate to File -> Settings -> Plugins and make sure the Lombok plugin is installed.

    4. Restart IntelliJ Idea - The most likely missed part :)

    这篇关于如何解决:IntelliJ中似乎无法识别Lombok builder()方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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