Lombok not working with IntelliJ 2020.3 Community Edition

ぐ巨炮叔叔 提交于 2021-01-20 23:41:48

问题


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?


回答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




回答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)




回答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




回答4:


Seems like lombok is not bundled in Community edition of 2020.3 version. Fix is expected in 2020.3.1 version.

From Lombok plugin GitHub issue

Sorry guys, I have to confirm, it was forgotten to add it properly into the last community build. See bug on Jetbrains Yourtrack: https://youtrack.jetbrains.com/issue/IDEA-257311

The Ultimate 2020.3 version contains lombok plugin as expected per default.

lombok plugin should be included in both IntelliJ distribution (Ultimate and Community) starting with 2020.3 release. Something get wrong, we are working to fix it.

Fix is now planned for IntelliJ Community release 2020.3.1

Update

2020.3.1 Community is released and contains lombok plugin by default now




回答5:


Please check in: Lombok plugin settings you didn't disable it unintentionally.




回答6:


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




回答7:


Installing Lombok plugin and enabling the annotation processor should do the needful. If still issue persists then i think you should report a bug and see what they reply.




回答8:


This is the problem with lombok, whenever IntelliJ provides upgrade lombok starts crying. Same happened with IntelliJ 2020.2

Now there are 2 solutions

  1. Wait till the developers of lombok provide upgrade compatible with IntelliJ 2020.3
  2. Downgrade IntelliJ to previous working version. For me IntelliJ 2020.2 worked perfectly fine.


来源:https://stackoverflow.com/questions/65095215/lombok-not-working-with-intellij-2020-3-community-edition

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!