franzbecker / gradle-lombok

Gradle plugin for Lombok support

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

"error: package lombok does not exist" when generating javadoc as of 1.12

ob-stripe opened this issue · comments

Hi! Thanks for this plugin.

I maintain a project that uses Lombok and the gradle-lombok plugin. The Javadoc task is configured as indicated in the README.

We've also configured Lombok to add @lombok.Generated annotations on generated methods (via lombok.addLombokGeneratedAnnotation = true in lombok.config).

Using version 1.11 of the gradle-lombok plugin, this works fine. However, when I try upgrading to version 1.12 or more recent, every @lombok.Generated annotation generates an error:

Foo.java:123: error: package lombok does not exist
  @lombok.Generated
         ^

I'm guessing something changed in the way the classpath is configured and the Javadoc task no longer gets Lombok in its classpath. This wouldn't be an issue when processing delomboked sources, except if the sources use the @lombok.Generated annotation.

Do you think this is an issue with the plugin, or should this be solved by tweaking the configuration of my build.gradle file?

Nevermind, I finally realized our Gradle build pipeline had a different Javadoc task that overrides the classpath 🤦‍♂️