The plugin includes by default: --module-path, --add-modules and -classpath options.
Optionally, the configuration can be modified with:
mainClass: The main class, fully qualified name, with or without module name
workingDirectory: The current working directory
skip: Skip the execution. Values: false (default), true
outputFile: File to redirect the process output
options: A list of VM options passed to the executable.
commandlineArgs: Arguments separated by space for the executed program
includePathExceptionsInClasspath: When resolving the module-path, setting this value to true will include the
dependencies that generate path exceptions in the classpath. By default, the value is false, and these dependencies
won't be included.
runtimePathOption: By default, the plugin will place each dependency either on modulepath or on classpath (based on certain factors).
When runtimePathOption configuration is set, the plugin will place all the dependencies on either modulepath or classpath.
If set as MODULEPATH, a module descriptor is required. All dependencies need to be either modularized or contain an Automatic-Module-Name.
If set as CLASSPATH, a Launcher class (like this one)
is required to run a JavaFX application. Also, if a module-info descriptor is present, it will be ignored.
Values: MODULEPATH or CLASSPATH.
This plugin supports Maven toolchains using the "jdk" tool.
Example
The following configuration adds some VM options, and a command line argument:
publicstaticvoidmain(String[] args) {
if (args.length > 0 && "foo".equals(args[0])) {
// do something
}
if ("myBar".equals(System.getProperty("bar"))) {
// do something
}
launch();
}
Note that the evaluation of System.getProperty("bar") can happen in any other place in the code.
Note
It is possible to use a local SDK instead of Maven Central.
This is helpful for developers trying to test a local build of OpenJFX.
Since transitive dependencies are not resolved,
all the required jars needs to be added as a separate dependency, like:
请发表评论