JavaFX plugin forces Gradle to put libraries on the modulepath instead of the classpath
See original GitHub issueHow to reproduce:
- Gradle version 6.7.1
- JavaFX plugin version 0.0.9
Given a modular project with a module-info.java in its main root. And the following Gradle config:
java {
modularity.inferModulePath.set(true)
toolchain {
languageVersion.set(JavaLanguageVersion.of(11))
}
}
And a non-modular test dependency, e.g.
testImplementation("com.tngtech.archunit:archunit-junit5:0.14.1")
And a test case, e.g.
@AnalyzeClasses(packages = "*", importOptions = { ImportOption.DoNotIncludeTests.class })
public class ArchitectureTest {
@ArchTest
public static final ArchRule CYCLE_RULE = slices().matching("..(*)..").should().beFreeOfCycles();
}
When I run the test case with Gradle 6.7.1
Expected behaviour: Then the test case runs
Current behaviour: Then the test case does not run, due to a java.lang.module.ResolutionException
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:5
Top Results From Across the Web
How to force gradle to add dependencies to the module path ...
I'm running my project in eclipse but every time I refresh the project, all dependencies are put to the class path instead of...
Read more >JavaFX plugin forces Gradle to put libraries on the modulepath ...
JavaFX plugin forces Gradle to put libraries on the modulepath instead of the classpath.
Read more >Gradle doesn't add modules to module-path during compile
I started a new project, which is modularized. It contains 4 dependencies, two of which is also modularized. ... requires javafx.controls; ...
Read more >A Guide to Java 9 Modularity - Baeldung
Learn the essentials of building and using modules in Java 9. Start down the path of modularizing your code today.
Read more >Create a new JavaFX project | IntelliJ IDEA Documentation
Make sure the JavaFX plugin is enabled · In the Settings/Preferences dialog ( Ctrl+Alt+S ), select Plugins. · Switch to the Installed tab...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
As workaround, remove javafx-gradle-plugin and add JavaFX manually:
This works with Gradle 6.7. All used JavaFX modules must be added because transitiv dependencies are not solved automatically. For my use case, the javafx-gradle-plugin should only resolve transitive dependencies of JavaFX module and platform.
Sure. I’ll look into it when I have some time.