Lombok在IntelliJ IDEA的配置

Lombok

Lombok是一个可以通过简单的注解形式来帮助我们简化消除一些必须有但显得很臃肿的Java代码的工具,通过使用对应的注解,可以在编译源码的时候生成对应的方法。官方地址:https://projectlombok.org/

如果配置不當

Error : The method ** is undefined

idea中如何配置

  1. 安装安装Lombok
    File->Settings->Plugins->Browse repositories…
    安装Lombok

  2. 配置agent
    File->Settings->Plugins->Build,Execution,Deployment->Complier
    配置agent

  3. 配置编译方式
    File->Settings->Plugins->Build,Execution,Deployment->Complier->Java complier
    配置编译方式

  4. 启用注解处理
    File->Settings->Plugins->Build,Execution,Deployment->Complier->Annotation Processors
    启用注解处理

  5. 重启后重新编译,否则不会生效。