Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Lombok not working with IntelliJ 2020.3 Community Edition

I worked with Lombok without any problems until Today, when my Intellij was automatically updated to the latest version 2020.3 30th, November build. After that, any Lombok annotations is not recognised anymore.

My Java project still build from command line with Maven but annotations are completely ignored in the project and cannot run any unit tests manually.

Things I tried so far:

  • Reinstalled the Lombok plugin
  • Restarted Intellij
  • Restarted the laptop
  • Invalidated the cache
  • Re-cloned the project from github
  • Checked that the annotation processor is enabled

Nothing worked. What could have happened? Any idea on what I can try to do?

like image 501
user1883212 Avatar asked Dec 01 '20 17:12

user1883212


People also ask

Does IntelliJ come with Lombok?

As of IntelliJ version 2020.3, we don't need to configure the IDE to use Lombok anymore. The IDE comes bundled with the plugin. Also, the annotation processing will be enabled automatically.

Why Lombok is not working in Eclipse?

Eclipse 2020-12 (Eclipse 2020-12 Java) does not support Lombok. It runs fine, but the IDE shows errors for all Lombok generates getters/setters. The previous version of Eclipse work fine. You have to install lombok on your installation, otherwise Eclipse will not be able to handle the Lombok-Annotations.

Does your IntelliJ work with Lombok?

I worked with Lombok without any problems until Today, when my Intellij was automatically updated to the latest version 2020.3 30th, November build. After that, any Lombok annotations is not recognised anymore.

Why Lombok is not working in Java?

java: You aren't using a compiler supported by lombok, so lombok will not work and has been disabled. Any project compiled in IntelliJ is affected. IntelliJ is now wrapping the ProcessingEnvironment in a Proxy.

What's new in the Lombok plugin?

The Lombok plugin is now built-in. IntelliJ IDEA can download shared indexes for popular Maven libraries directly from JetBrains’ servers. If you develop plugins with an IntelliJ Platform SDK, shared indexes will be downloaded automatically.

Is it possible to use Lombok author with JetBrains?

Lombok plug-in author now works for JetBrains and Lombok plug-in is bundled with IntelliJ IDEA, so you don't need to install it separately or update it manually like before. It will be always compatible with the current IDE version from now on. This issue cannot be fixed by the plug-in update. No. These two are unrelated. See my comments above.


3 Answers

To summarize go to IntelliJ Preferences (Cmd + ,)

Preferences -> Build, Execution, Deployment -> Compiler

search for this option:

User-local build process VM options (overrides Shared options):

and add this value:

-Djps.track.ap.dependencies=false

like image 154
Mike Avatar answered Oct 18 '22 00:10

Mike


A work around is here, until they fix the actual problem:

https://youtrack.jetbrains.com/issue/IDEA-250718#focus=Comments-27-4418347.0-0

(see screenshoot for IJ fix)

like image 36
user1883212 Avatar answered Oct 18 '22 00:10

user1883212


My problem was related to my lombok version

Before upgrade my IntelliJ to 2020.03 my lombok version was 1.18.10 and the lombok plugin 0.32-EAP

After upgrade my lombok dependency to 1.18.16 it start work again without any issues. Looks like the plugin is not bundled yet in the community edition.

I don't if is necessary, but my first action was to uninstall the plugin when I read the README on Lombok Plugin repo

like image 2
Rogério Ramos Avatar answered Oct 18 '22 00:10

Rogério Ramos