Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugin fails on Ubuntu/OpenJDK 10/Jigsaw #26

Open
newcron opened this issue Aug 30, 2018 · 5 comments
Open

Plugin fails on Ubuntu/OpenJDK 10/Jigsaw #26

newcron opened this issue Aug 30, 2018 · 5 comments

Comments

@newcron
Copy link

newcron commented Aug 30, 2018

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)

@awhitford
Copy link
Owner

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
Copy link
Owner

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
Copy link
Owner

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;
    }
}

@newcron
Copy link
Author

newcron commented Nov 8, 2018

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.

@awhitford
Copy link
Owner

This issue sounds related to projectlombok/lombok#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.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants