Package org.openjfx
Class JavaFXBaseMojo
- java.lang.Object
-
- org.apache.maven.plugin.AbstractMojo
-
- org.openjfx.JavaFXBaseMojo
-
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled,org.apache.maven.plugin.Mojo
- Direct Known Subclasses:
JavaFXJLinkMojo,JavaFXRunMojo
abstract class JavaFXBaseMojo extends org.apache.maven.plugin.AbstractMojo
-
-
Field Summary
Fields Modifier and Type Field Description private booleanasyncIf set to true the child process executes asynchronously and build execution continues in parallel.private booleanasyncDestroyOnShutdownIf set to true, the asynchronous child process is destroyed upon JVM shutdown.(package private) java.io.Filebasedir(package private) java.io.Filebuilddir(package private) java.util.List<java.lang.String>classpathElements(package private) java.lang.StringcommandlineArgsArguments separated by space for the executed program.private java.util.List<java.lang.String>compilePathprivate booleanincludePathExceptionsInClasspathIf set to true, it will include the dependencies that generate path exceptions in the classpath.(package private) static java.lang.StringJAVAFX_PREFIXprivate org.codehaus.plexus.languages.java.jpms.LocationManagerlocationManager(package private) java.lang.StringmainClass(package private) org.codehaus.plexus.languages.java.jpms.JavaModuleDescriptormoduleDescriptor(package private) java.util.List<java.lang.String>modulepathElements(package private) java.util.List<?>optionsA list of vm options passed to theexecutable.(package private) java.io.FileoutputFile(package private) java.util.Map<java.lang.String,org.codehaus.plexus.languages.java.jpms.JavaModuleDescriptor>pathElementsprivate org.apache.maven.plugin.BuildPluginManagerpluginManagerprivate org.apache.commons.exec.ProcessDestroyerprocessDestroyer(package private) org.apache.maven.project.MavenProjectprojectprivate java.lang.StringreleaseThe -release argument for the Java compilerprivate org.apache.maven.execution.MavenSessionsession(package private) booleanskipSkip the execution.private java.lang.StringsourceThe -source argument for the Java compiler.private java.lang.StringtargetThe -target argument for the Java compiler.(package private) java.io.FileworkingDirectoryThe current working directory.
-
Constructor Summary
Constructors Constructor Description JavaFXBaseMojo()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) intexecuteCommandLine(org.apache.commons.exec.Executor exec, org.apache.commons.exec.CommandLine commandLine, java.util.Map<java.lang.String,java.lang.String> enviro, java.io.FileOutputStream outputFile)(package private) intexecuteCommandLine(org.apache.commons.exec.Executor exec, org.apache.commons.exec.CommandLine commandLine, java.util.Map<java.lang.String,java.lang.String> enviro, java.io.OutputStream out, java.io.OutputStream err)private intexecuteCommandLine(org.apache.commons.exec.Executor exec, org.apache.commons.exec.CommandLine commandLine, java.util.Map<java.lang.String,java.lang.String> enviro, org.apache.commons.exec.PumpStreamHandler psh)private static java.lang.StringfindExecutable(java.lang.String executable, java.util.List<java.lang.String> paths)private java.util.List<java.io.File>getCompileClasspathElements(org.apache.maven.project.MavenProject project)private static java.util.List<java.lang.String>getExecutableExtensions()(package private) org.apache.commons.exec.CommandLinegetExecutablePath(java.lang.String executable, java.util.Map<java.lang.String,java.lang.String> enviro, java.io.File dir)private java.util.List<java.lang.String>getExecutablePaths(java.util.Map<java.lang.String,java.lang.String> enviro)private java.lang.StringgetJavaHomeEnv(java.util.Map<java.lang.String,java.lang.String> enviro)(package private) static java.nio.file.PathgetParent(java.nio.file.Path path, int depth)Returns the path of the parent directory.private org.apache.commons.exec.ProcessDestroyergetProcessDestroyer()(package private) java.util.Map<java.lang.String,java.lang.String>handleSystemEnvVariables()(package private) voidhandleWorkingDirectory()private static booleanhasExecutableExtension(java.lang.String exec)private static booleanhasNativeExtension(java.lang.String exec)(package private) static booleanisMavenUsingJava8()(package private) static booleanisTargetUsingJava8(org.apache.commons.exec.CommandLine commandLine)(package private) voidpreparePaths(java.nio.file.Path jdkHome)-
Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
-
-
-
-
Field Detail
-
JAVAFX_PREFIX
static final java.lang.String JAVAFX_PREFIX
- See Also:
- Constant Field Values
-
project
@Parameter(defaultValue="${project}", readonly=true) org.apache.maven.project.MavenProject project
-
session
@Parameter(defaultValue="${session}", readonly=true) private org.apache.maven.execution.MavenSession session
-
pluginManager
@Component private org.apache.maven.plugin.BuildPluginManager pluginManager
-
locationManager
@Component private org.codehaus.plexus.languages.java.jpms.LocationManager locationManager
-
mainClass
@Parameter(property="javafx.mainClass", required=true) java.lang.String mainClass
-
skip
@Parameter(property="javafx.skip", defaultValue="false") boolean skipSkip the execution.
-
basedir
@Parameter(readonly=true, required=true, defaultValue="${basedir}") java.io.File basedir
-
builddir
@Parameter(readonly=true, required=true, defaultValue="${project.build.directory}") java.io.File builddir
-
workingDirectory
@Parameter(property="javafx.workingDirectory") java.io.File workingDirectory
The current working directory. Optional. If not specified, basedir will be used.
-
compilePath
@Parameter(defaultValue="${project.compileClasspathElements}", readonly=true, required=true) private java.util.List<java.lang.String> compilePath
-
outputFile
@Parameter(property="javafx.outputFile") java.io.File outputFile
-
async
@Parameter(property="javafx.async", defaultValue="false") private boolean asyncIf set to true the child process executes asynchronously and build execution continues in parallel.
-
asyncDestroyOnShutdown
@Parameter(property="javafx.asyncDestroyOnShutdown", defaultValue="true") private boolean asyncDestroyOnShutdownIf set to true, the asynchronous child process is destroyed upon JVM shutdown. If set to false, asynchronous child process continues execution after JVM shutdown. Applies only to asynchronous processes; ignored for synchronous processes.
-
options
@Parameter java.util.List<?> options
A list of vm options passed to the
executable.
-
commandlineArgs
@Parameter(property="javafx.args") java.lang.String commandlineArgs
Arguments separated by space for the executed program. For example: "-j 20"
-
source
@Parameter(property="javafx.source", defaultValue="11") private java.lang.String sourceThe -source argument for the Java compiler.
-
target
@Parameter(property="javafx.target", defaultValue="11") private java.lang.String targetThe -target argument for the Java compiler.
-
release
@Parameter(property="javafx.release", defaultValue="11") private java.lang.String releaseThe -release argument for the Java compiler
-
includePathExceptionsInClasspath
@Parameter(property="javafx.includePathExceptionsInClasspath", defaultValue="false") private boolean includePathExceptionsInClasspathIf set to true, it will include the dependencies that generate path exceptions in the classpath. Default is false.
-
classpathElements
java.util.List<java.lang.String> classpathElements
-
modulepathElements
java.util.List<java.lang.String> modulepathElements
-
pathElements
java.util.Map<java.lang.String,org.codehaus.plexus.languages.java.jpms.JavaModuleDescriptor> pathElements
-
moduleDescriptor
org.codehaus.plexus.languages.java.jpms.JavaModuleDescriptor moduleDescriptor
-
processDestroyer
private org.apache.commons.exec.ProcessDestroyer processDestroyer
-
-
Method Detail
-
isMavenUsingJava8
static boolean isMavenUsingJava8()
-
isTargetUsingJava8
static boolean isTargetUsingJava8(org.apache.commons.exec.CommandLine commandLine)
-
preparePaths
void preparePaths(java.nio.file.Path jdkHome) throws org.apache.maven.plugin.MojoExecutionException- Throws:
org.apache.maven.plugin.MojoExecutionException
-
getCompileClasspathElements
private java.util.List<java.io.File> getCompileClasspathElements(org.apache.maven.project.MavenProject project)
-
handleWorkingDirectory
void handleWorkingDirectory() throws org.apache.maven.plugin.MojoExecutionException- Throws:
org.apache.maven.plugin.MojoExecutionException
-
handleSystemEnvVariables
java.util.Map<java.lang.String,java.lang.String> handleSystemEnvVariables()
-
getExecutablePath
org.apache.commons.exec.CommandLine getExecutablePath(java.lang.String executable, java.util.Map<java.lang.String,java.lang.String> enviro, java.io.File dir)
-
executeCommandLine
int executeCommandLine(org.apache.commons.exec.Executor exec, org.apache.commons.exec.CommandLine commandLine, java.util.Map<java.lang.String,java.lang.String> enviro, java.io.OutputStream out, java.io.OutputStream err) throws org.apache.commons.exec.ExecuteException, java.io.IOException- Throws:
org.apache.commons.exec.ExecuteExceptionjava.io.IOException
-
executeCommandLine
int executeCommandLine(org.apache.commons.exec.Executor exec, org.apache.commons.exec.CommandLine commandLine, java.util.Map<java.lang.String,java.lang.String> enviro, java.io.FileOutputStream outputFile) throws org.apache.commons.exec.ExecuteException, java.io.IOException- Throws:
org.apache.commons.exec.ExecuteExceptionjava.io.IOException
-
getParent
static java.nio.file.Path getParent(java.nio.file.Path path, int depth)Returns the path of the parent directory. At the given depth if the path has no parent, the method returns null.- Parameters:
path- Path against which the parent needs to be evaluateddepth- Depth of the path relative to parent- Returns:
- Path to the parent, if exists. Null, otherwise.
-
findExecutable
private static java.lang.String findExecutable(java.lang.String executable, java.util.List<java.lang.String> paths)
-
hasNativeExtension
private static boolean hasNativeExtension(java.lang.String exec)
-
hasExecutableExtension
private static boolean hasExecutableExtension(java.lang.String exec)
-
getExecutableExtensions
private static java.util.List<java.lang.String> getExecutableExtensions()
-
getExecutablePaths
private java.util.List<java.lang.String> getExecutablePaths(java.util.Map<java.lang.String,java.lang.String> enviro)
-
getJavaHomeEnv
private java.lang.String getJavaHomeEnv(java.util.Map<java.lang.String,java.lang.String> enviro)
-
executeCommandLine
private int executeCommandLine(org.apache.commons.exec.Executor exec, org.apache.commons.exec.CommandLine commandLine, java.util.Map<java.lang.String,java.lang.String> enviro, org.apache.commons.exec.PumpStreamHandler psh) throws org.apache.commons.exec.ExecuteException, java.io.IOException- Throws:
org.apache.commons.exec.ExecuteExceptionjava.io.IOException
-
getProcessDestroyer
private org.apache.commons.exec.ProcessDestroyer getProcessDestroyer()
-
-