-
Notifications
You must be signed in to change notification settings - Fork 33
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
delombok does not find all modules on module path #824
Comments
Could be this bug from lombok itself: projectlombok/lombok#2829 |
It looks like the solution was a plugin that skips module-info.java when delombok is run. Maybe this is an option you can add to the Delombok task? |
This is what I came up with to fix my issue in gradle.
This is how I came about my fix. delombok fails to compile module-info and a lot of classes for missing modules for example lombok
I decided to try logging and it showed a lombok options file is used. This is what it had.
There is no module-path and this is the problem. I also noticed the task has a configuration for modulePath. Then I had an idea.
It works! I hope this helps anyone having this issue. @A-Willems I think in your case you should use the compile classpath but it might be easier to assign the delombok.classpath property to the delombok.modulePath property as I have done. I think in the case where you want to compile without modules you have to exclude the module-info somehow. |
After we migrated our project to the Java Module System we encountered that not all modules on the
modulePath
are recognized.The attached example is a simple gradle project that can be used to reproduce the problem: module-sample.zip
First,
gradlew :application:run
shows that themodule-info.java
is implemented correctly and the program executes as it should.My
module-info.java
looks like this:My
delombok
task allows to run with or withoutmodulePath
, so it's easier to reproduce the problem from command line:Calling
gradlew :application:delombok
does not set thedelombok modulePath
and produces the following output:This shows, that there are three modules (
org.slf4j
,com.google.gson
andorg.apache.commons.lang3
) that cannot be found. In this case it is not surprising as the modulePath was not set.Finally calling
gradlew -PwithModulePath :application:delombok
produces:In this case, the module path of the
delombok
task is set (which I confirmed in the temporarily generateddelombok.options
). Now, the Apache Commons module was found, but SLF4J and GSON were still missing.The question is: Am I doing something wrong or is this a problem within the
delombok
task?Regards,
Achim
The text was updated successfully, but these errors were encountered: