Search code examples
spring-bootintellij-ideaivylombokintellij-lombok-plugin

Strange compilation errors using Lombok with IntelliJ


We have an application using Sprint Boot with Ivy for dependency management. We use IntelliJ as our IDE.

First, the app compiles without errors. However, we're getting "compilation errors" (quoted because they look like compilation errors in the IDE but the app still compiles) such as "cannot resolve symbol" and "cannot resolve method" when it comes to trying to access getters/setters/etc created with Lombok.

Here's some addition info:

  • @Data works - no compilation error
  • Lombok doesn't show up under Settings -> Plugins
  • lombok-1.16.10.jar is in the lib folder
  • It is listed as a dependency in the ivy.xml file
  • Annotation processing is enabled
  • Downloading the plugin itself is not an option on our network

If anyone has any ideas we're all ears. Thanks!


Solution

  • You need to have the plugin installed. Without the plugin, IntelliJ IDEA does not recognize the method generated by Lombok; it does not use javac or its annotation processors, but rather uses its own code model which gets extended by the Lombok plugin.

    If you can't download the plugin from your network, you can download it from a different network and then use "Install plugin from disk" to install it as a file.