Open tlinkowski opened 5 years ago
I believe that I have had the same/a related issue, since changing the version to 1.6.0 in my project - build/classes/merged
is now part of the module-path while build/classes/java
and build/classes/kotlin
are now not part of the module-path (which it was when I used 1.5.0)
When targeting JDK 11, in a project that has Java, Kotlin, and Groovy plugins applied but has only Java sources,
run
task fails with:It seems to be due to:
run
task gettingbuild/classes/merged
on a module path (as it shouldn't)mergeClasses
task being absent (as it should)Example
This behavior is exemplified on a branch of my project, where
run
fails like below: https://travis-ci.com/tlinkowski/UniJ/builds/127633638#L1234-L1236For a module targeting JDK 8, it works fine, though: https://travis-ci.com/tlinkowski/UniJ/jobs/235293201#L1271-L1273
In a debugger, I managed to find out that for JDK 11,
run
is instrumented with the following command line arguments:As you can see, we have
build\classes\merged
which shouldn't be there according to the spec from #101. However,:pl.tlinkowski.unij.sample.enduser.jdk11:mergeClasses
task was not run (and was not present, which I confirmed in the debugger).Conclusions
Because we:
mergeClasses
tasksbuild/classes/merged
on the module pathit seems to me that the two calls to
isMergeRequired
return different results:returns
false
: https://github.com/java9-modularity/gradle-modules-plugin/blob/29d5d8db84258a1e1199a79f9017fad7c3437692/src/main/java/org/javamodularity/moduleplugin/tasks/MergeClassesTask.java#L19-L22returns
true
: https://github.com/java9-modularity/gradle-modules-plugin/blob/5e49c01f49a6e830c64b29f31eba0f064cf1d45d/src/main/java/org/javamodularity/moduleplugin/tasks/MergeClassesHelper.java#L65-L68I haven't yet confirmed if they really do return different results, and - if so - why it happens.