franzbecker / gradle-lombok

Gradle plugin for Lombok support
Apache License 2.0
182 stars 22 forks source link

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

Closed ob-stripe closed 6 years ago

ob-stripe commented 6 years ago

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?

ob-stripe commented 6 years ago

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