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?
Solution 1:
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
Solution 2:
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)
Solution 3:
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
Solution 4:
I was using Lombok fine with 2020.2 and plugin, but in 2020.3.1 it should be (and it is) included
...but I had compilation errors like Cannot resolve symbol 'log'
(when using @Slf4j
)
I solved the problem deleting .idea from project and opened it again...
edit: it happened to me again today with new checkout (we do not have .idea in Git) and I had similar problem. Not sure if that was a fix, but I checked the plugin (it is not on screenshot above), it started working after, but I built it from cmd (Maven) and tried few other things, so I'm not sure what is a real fix