Package org.openjfx

Class 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 boolean async
      If set to true the child process executes asynchronously and build execution continues in parallel.
      private boolean asyncDestroyOnShutdown
      If set to true, the asynchronous child process is destroyed upon JVM shutdown.
      (package private) java.io.File basedir  
      (package private) java.io.File builddir  
      (package private) java.util.List<java.lang.String> classpathElements  
      (package private) java.lang.String commandlineArgs
      Arguments separated by space for the executed program.
      private java.util.List<java.lang.String> compilePath  
      private boolean includePathExceptionsInClasspath
      If set to true, it will include the dependencies that generate path exceptions in the classpath.
      (package private) static java.lang.String JAVAFX_PREFIX  
      private org.codehaus.plexus.languages.java.jpms.LocationManager locationManager  
      (package private) java.lang.String mainClass  
      (package private) org.codehaus.plexus.languages.java.jpms.JavaModuleDescriptor moduleDescriptor  
      (package private) java.util.List<java.lang.String> modulepathElements  
      (package private) java.util.List<?> options
      A list of vm options passed to the executable.
      (package private) java.io.File outputFile  
      (package private) java.util.Map<java.lang.String,​org.codehaus.plexus.languages.java.jpms.JavaModuleDescriptor> pathElements  
      private org.apache.maven.plugin.BuildPluginManager pluginManager  
      private org.apache.commons.exec.ProcessDestroyer processDestroyer  
      (package private) org.apache.maven.project.MavenProject project  
      private java.lang.String release
      The -release argument for the Java compiler
      private org.apache.maven.execution.MavenSession session  
      (package private) boolean skip
      Skip the execution.
      private java.lang.String source
      The -source argument for the Java compiler.
      private java.lang.String target
      The -target argument for the Java compiler.
      (package private) java.io.File workingDirectory
      The current working directory.
      • Fields inherited from interface org.apache.maven.plugin.Mojo

        ROLE
    • Constructor Summary

      Constructors 
      Constructor Description
      JavaFXBaseMojo()  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      (package 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, java.io.FileOutputStream outputFile)  
      (package 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, java.io.OutputStream out, java.io.OutputStream err)  
      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)  
      private static java.lang.String findExecutable​(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.CommandLine getExecutablePath​(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.String getJavaHomeEnv​(java.util.Map<java.lang.String,​java.lang.String> enviro)  
      (package private) static java.nio.file.Path getParent​(java.nio.file.Path path, int depth)
      Returns the path of the parent directory.
      private org.apache.commons.exec.ProcessDestroyer getProcessDestroyer()  
      (package private) java.util.Map<java.lang.String,​java.lang.String> handleSystemEnvVariables()  
      (package private) void handleWorkingDirectory()  
      private static boolean hasExecutableExtension​(java.lang.String exec)  
      private static boolean hasNativeExtension​(java.lang.String exec)  
      (package private) static boolean isMavenUsingJava8()  
      (package private) static boolean isTargetUsingJava8​(org.apache.commons.exec.CommandLine commandLine)  
      (package private) void preparePaths​(java.nio.file.Path jdkHome)  
      • Methods inherited from class org.apache.maven.plugin.AbstractMojo

        getLog, getPluginContext, setLog, setPluginContext
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface org.apache.maven.plugin.Mojo

        execute
    • Field Detail

      • 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 skip
        Skip 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 async
        If set to true the child process executes asynchronously and build execution continues in parallel.
      • asyncDestroyOnShutdown

        @Parameter(property="javafx.asyncDestroyOnShutdown",
                   defaultValue="true")
        private boolean asyncDestroyOnShutdown
        If 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 source

        The -source argument for the Java compiler.

      • target

        @Parameter(property="javafx.target",
                   defaultValue="11")
        private java.lang.String target

        The -target argument for the Java compiler.

      • release

        @Parameter(property="javafx.release",
                   defaultValue="11")
        private java.lang.String release
        The -release argument for the Java compiler
      • includePathExceptionsInClasspath

        @Parameter(property="javafx.includePathExceptionsInClasspath",
                   defaultValue="false")
        private boolean includePathExceptionsInClasspath
        If 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
    • Constructor Detail

      • JavaFXBaseMojo

        JavaFXBaseMojo()
    • 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.ExecuteException
        java.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.ExecuteException
        java.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 evaluated
        depth - 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.ExecuteException
        java.io.IOException
      • getProcessDestroyer

        private org.apache.commons.exec.ProcessDestroyer getProcessDestroyer()