badass-runtime-plugin icon indicating copy to clipboard operation
badass-runtime-plugin copied to clipboard

Add additional module paths

Open DJViking opened this issue 4 years ago • 0 comments

Currently it is not possible to add modules on a separate module path than the JDK. For example if one wants to create a runtime image with the JavaFX jmods.

In order to use the runtime image created by this plugin with JavaFX, one would need to create a separate Launcher main class application, as has been done in the badass-runtime-example-javafx.

Until I discovered this plugin we had Exec tasks for creating a runtime image with jlink. Even though we had javafx as dependencies (through the javafxplugin), we built the runtime image with the JavaFX jmods. Because of this we did not have to create such a Launcher class to run the application. Though then the build script thus had to download and unpack the JavaFX jmods.

The module path is set to the running JDK jmods directory

--module-path /usr/java/jdk-11.0.4+11/jmods

An extra module path option could be prefixed/postfixed to this Such that the --module-path would be

--module-path /dir/to/jmods:/usr/java/jdk-11.0.4+11/jmods

Same solution from Badass JLink Plugin could be used. Using the extraModulePaths.

DJViking avatar Sep 09 '19 12:09 DJViking