49

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?

user1883212
  • 7,539
  • 11
  • 46
  • 82
  • 1
    Seems the be related to: https://stackoverflow.com/questions/66170975/jps-incremental-annotation-processing-is-disabled-compilation-results-on-partia/66174087 – Sled Apr 22 '21 at 20:49

9 Answers9

78

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

Mike
  • 951
  • 5
  • 7
  • 5
    The proper solution is to update Lombok dependency: https://github.com/mplushnikov/lombok-intellij-plugin/issues/988#issuecomment-737328145. – CrazyCoder Dec 04 '20 at 20:08
  • 2
    I also need to run `Rebuild` instead of `Build` to make it work. – Searene Feb 09 '21 at 03:35
11

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)

user1883212
  • 7,539
  • 11
  • 46
  • 82
  • This fixed the same issue I have. The issue you linked appears to be fixed in 2020.3, do you known if there is a regression? – Loïc Dec 02 '20 at 13:51
  • 1
    Not sure about that... but the link shows this is fixed in the build 203.4267. However my build is 203.5981.155 and the bug is still there. IJ only works with the work around. – user1883212 Dec 02 '20 at 14:59
  • This actually should be fixed in the last IDE and Lombok plugin versions and there should be no need to set the `-Djps.track.ap.dependencies=false` option. Could you please tell what exact Lombok plugin versions do you use in 2020.3 when it does not work if you do not set this option manually? Thanks. – Andrey Dec 02 '20 at 17:53
  • @Andrey -- is there a release of the Lombok plug-in for 2020.3 -- looking on the Github site, I don't see one (last release is 0.33-2020.2). The JetBrains marketplace shows the same thing (last release on Oct 28). – sfitts Dec 03 '20 at 17:18
  • The plugin is bundled with IntelliJ IDEA now. So after update the plugin should be also updated.To check you have the latest version you can via Help | Check For Updates action. – Andrey Dec 04 '20 at 19:20
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

  • IntelliJ IDEA 2020.3 (Community Edition) Build #IC-203.5981.155, built on November 30, 2020 Runtime version: 11.0.9+11-b1145.21 amd64 VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o. Linux 5.8.18-1-manjaro GC: ParNew, ConcurrentMarkSweep Memory: 1892M Cores: 8 Non-Bundled Plugins: google-java-format, Lombook Plugin Current Desktop: GNOME – Rogério Ramos Dec 04 '20 at 20:03
  • 1
    It's indeed a bug in Lombok and it was fixed some time ago, so the solution is to update to the current Lombok version. You update Lombok dependency itself, not the plug-in: https://github.com/rzwitserloot/lombok/issues/2592. See also [this comment](https://github.com/mplushnikov/lombok-intellij-plugin/issues/988#issuecomment-737328145). – CrazyCoder Dec 04 '20 at 20:07
3

I was using Lombok fine with 2020.2 and plugin, but in 2020.3.1 it should be (and it is) included

Lombok plugin bundled, Idea 2020.3

...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

Betlista
  • 10,327
  • 13
  • 69
  • 110
3

I managed to make it work on a gradle project (Intellij 2020.3.2) by using exactly this in build.gradle :

annotationProcessor 'org.projectlombok:lombok:1.18.18'
implementation 'org.projectlombok:lombok:1.18.18'

I think important point is to declare it as "annotationProcessor" to include it in the gradle build. I did not even have to mess around with "User-local build process VM options" and even "Enable Annotation Processing" is not ticked in Intellij Settings. So I guess that gradle is taking care of the Lombok generation, and not IDEA. but at least it finally works after hours lost trying to fix IntelliJ.

R. Du
  • 544
  • 4
  • 16
1

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

mplushnikov
  • 104
  • 2
1

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

Smile
  • 3,832
  • 3
  • 25
  • 39
0

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.
firoj_mujawar
  • 301
  • 4
  • 14
  • I was in impression that this will be an accepted Answer, but people who got more points already on StackOverflow are using those points just to down-vote the answers. For me this solution worked, that's why I shared. You can take this as a workaround till actual solution from lombok. But you guys want to invest your time in down-voting then happy investing. – firoj_mujawar Dec 03 '20 at 07:05
  • 1
    It's indeed a bug in Lombok and it was fixed some time ago, so the solution is to update to the current Lombok version. Please also don't mix it up with the Lombok IntelliJ IDEA plug-in. You update Lombok dependency itself, not the plug-in: https://github.com/rzwitserloot/lombok/issues/2592. See also [this comment](https://github.com/mplushnikov/lombok-intellij-plugin/issues/988#issuecomment-737328145). – CrazyCoder Dec 04 '20 at 20:04
  • I would never in my understanding ever mix-up any IDEA plugin and maven dependency. I was of-course talking about the plugin in the above answer. – firoj_mujawar Dec 12 '20 at 07:31
  • 1
    If you were talking about the plug-in, your answer is wrong. The fix is to update the dependency version. 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. – CrazyCoder Dec 12 '20 at 07:33
  • Are you saying, updating Lombok maven dependency version will update the Lombok IntelliJ plugin or it automatically make plugin to work as it was previously? If this is the case, then I am wondering how it is working for me for IntelliJ 2019 and not working for IntelliJ 2020.3! – firoj_mujawar Dec 15 '20 at 08:01
  • 1
    No. These two are unrelated. – CrazyCoder Dec 15 '20 at 08:02
  • Never mind my answer was a quick workaround. As far as I know, Lombok plugin is not compatible for IntelliJ 2020.3 as of now. Check compatibility here: https://plugins.jetbrains.com/plugin/6317-lombok/versions The latest version is 0.33 which is compatible with only IntelliJ 2020.2.X – firoj_mujawar Dec 15 '20 at 08:15
  • 1
    See my comments above. Lombok plug-in is now bundled with IntelliJ IDEA. Repository plug-in version is currently older than the one that comes with IntelliJ IDEA Ultimate download. – CrazyCoder Dec 15 '20 at 08:16
  • I'm sorry, how do you know this? any docs reference please? If your claim is right then it should work, right? – firoj_mujawar Dec 15 '20 at 08:19
  • Ok I got this. https://github.com/mplushnikov/lombok-intellij-plugin But bro it is still not working, only the above workaround worked for me, let me try this today. – firoj_mujawar Dec 15 '20 at 08:22
  • 2
    I work for JetBrains. You can download and install 2020.3 Ultimate from https://www.jetbrains.com/idea/download/index.html and check it yourself. IntelliJ IDEA Community 2020.3 doesn't bundle Lombok yet, but it's a [know issue](https://youtrack.jetbrains.com/issue/IDEA-257311) with the fix planned for 2020.3.1 update. – CrazyCoder Dec 15 '20 at 08:22
-1

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.

Bhupinder Singh
  • 3,355
  • 2
  • 11
  • 14