lombok.maven icon indicating copy to clipboard operation
lombok.maven copied to clipboard

Plugin fails on Ubuntu/OpenJDK 10/Jigsaw

Open newcron opened this issue 6 years ago • 5 comments

Hi, thanks a lot for the great plugin! I believe I found an issue with OpenJDK 10 on Ubuntu/Debian, where the plugin will fail to work correctly claiming that lombok is not on the module path

it does not find the module lombok, neither does it find any of it's annotations. even if they are there. The problem exists in regardless if lombok is a dependency with compile/runtime/provided scope.

I've created a sample project here to expose the issue. Sorry, if this is not an actual bug but just a misuse of the plugin. I've tried to get it working for over four hours without success, so I believe it is a bug.

(BTW: compiling the project directly in java with --processor-module-path works just fine, so I suspect it's not a problem of lombok itself)

newcron avatar Aug 30 '18 17:08 newcron

Please try with the latest release (1.18.2.0).

As a side note, I noticed that the output says:

[WARNING] Unable to detect tools.jar; java.home is /usr/lib/jvm/java-11-openjdk-amd64

I am surprised to see a Java 11 reference when you are trying to build with Java 10. Could that be a clue?

awhitford avatar Oct 08 '18 17:10 awhitford

I just resolved a Java 11 issue, but it was with my sample test project, not the core plugin. Travis CI builds are now including Java 11.

awhitford avatar Oct 27 '18 21:10 awhitford

Thanks for the sample project because it is incredibly important to be able to reproduce the issue.

I was able to get the sample project building fine after deleting this file:

  • module-a/src/main/java/module-info.java

I don't see the need for the file because, if everything goes correctly, your output does not reference lombok anymore:

// Generated by delombok at Sat Oct 27 15:05:16 PDT 2018
package de.newcron.mavenlombokjigsawsample.modulea;

public class Person {
    private final String firstname;
    private final String lastname;

    @java.lang.SuppressWarnings("all")
    public Person(final String firstname, final String lastname) {
        this.firstname = firstname;
        this.lastname = lastname;
    }
}

awhitford avatar Oct 27 '18 22:10 awhitford

Hi, @awhitford thanks for the answer (and sorry for just seeing this now).

For the tools.jar issue: This is related to a funny ubuntu quirk. There was a package for JDK 11 present in the latest LTS even though Java 11 was not released. At the time of opening the issue that package actually contained JDK 10. Nevertheless, it installed into an 11 directory. Ubuntus Goal was to upgrade it to contain the actual JDK 11 once released.

Thanks a lot for debugging the sample project. Unfortunately, deleting the module-info.java is not doing it for me in the real project where this issue showed up. In that actual project, there are reasons to keep the module-info for some other transitive dependencies (that would clash otherwise).

Keeping the module-info in place but just updating lombok to 1.18.4 (and mvn lombok plugin to 1.18.4.0) on java 10 still has the same issue.

newcron avatar Nov 08 '18 08:11 newcron

This issue sounds related to https://github.com/rzwitserloot/lombok/issues/1946. (I don't think that there is anything that the Maven Plugin can do as it seems to be a core Delombok issue with Modules.)

awhitford avatar Feb 13 '19 22:02 awhitford