Class AbstractJLinkMojo

  • All Implemented Interfaces:
    org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo
    Direct Known Subclasses:
    JLinkMojo

    public abstract class AbstractJLinkMojo
    extends org.apache.maven.plugin.AbstractMojo
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.util.Map<java.lang.String,​java.lang.String> jdkToolchain
      Specify the requirements for this jdk toolchain.
      private org.apache.maven.project.MavenProject project  
      private org.apache.maven.execution.MavenSession session  
      private org.apache.maven.toolchain.ToolchainManager toolchainManager  
      • Fields inherited from interface org.apache.maven.plugin.Mojo

        ROLE
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected java.lang.StringBuilder convertSeparatedModulePathToPlatformSeparatedModulePath​(java.lang.String pluginModulePath)
      This will convert a module path separated by either : or ; into a string which uses the platform depend path separator uniformly.
      protected void executeCommand​(org.codehaus.plexus.util.cli.Commandline cmd, java.io.File outputDirectory)  
      protected java.io.File getArchiveFile​(java.io.File basedir, java.lang.String finalName, java.lang.String classifier, java.lang.String archiveExt)
      Returns the archive file to generate, based on an optional classifier.
      protected java.lang.String getCommaSeparatedList​(java.util.List<java.lang.String> modules)
      Convert a list into a
      protected java.lang.String getJLinkExecutable()  
      protected java.lang.String getPlatformDependSeparateList​(java.util.List<java.lang.String> modulePaths)
      Convert a list into a string which is separated by platform depend path separator.
      protected org.apache.maven.project.MavenProject getProject()  
      protected org.apache.maven.execution.MavenSession getSession()  
      protected org.apache.maven.toolchain.Toolchain getToolchain()  
      protected boolean hasClassifier​(java.lang.String classifier)  
      • 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

      • jdkToolchain

        @Parameter
        private java.util.Map<java.lang.String,​java.lang.String> jdkToolchain

        Specify the requirements for this jdk toolchain. This overrules the toolchain selected by the maven-toolchain-plugin.

        note: requires at least Maven 3.3.1
      • project

        @Parameter(defaultValue="${project}",
                   readonly=true,
                   required=true)
        private org.apache.maven.project.MavenProject project
      • session

        @Parameter(defaultValue="${session}",
                   readonly=true,
                   required=true)
        private org.apache.maven.execution.MavenSession session
      • toolchainManager

        @Component
        private org.apache.maven.toolchain.ToolchainManager toolchainManager
    • Constructor Detail

      • AbstractJLinkMojo

        public AbstractJLinkMojo()
    • Method Detail

      • getJLinkExecutable

        protected java.lang.String getJLinkExecutable()
                                               throws java.io.IOException
        Throws:
        java.io.IOException
      • executeCommand

        protected void executeCommand​(org.codehaus.plexus.util.cli.Commandline cmd,
                                      java.io.File outputDirectory)
                               throws org.apache.maven.plugin.MojoExecutionException
        Throws:
        org.apache.maven.plugin.MojoExecutionException
      • getToolchain

        protected org.apache.maven.toolchain.Toolchain getToolchain()
      • getProject

        protected org.apache.maven.project.MavenProject getProject()
      • getSession

        protected org.apache.maven.execution.MavenSession getSession()
      • getArchiveFile

        protected java.io.File getArchiveFile​(java.io.File basedir,
                                              java.lang.String finalName,
                                              java.lang.String classifier,
                                              java.lang.String archiveExt)
        Returns the archive file to generate, based on an optional classifier.
        Parameters:
        basedir - the output directory
        finalName - the name of the ear file
        classifier - an optional classifier
        archiveExt - The extension of the file.
        Returns:
        the file to generate
      • hasClassifier

        protected boolean hasClassifier​(java.lang.String classifier)
      • convertSeparatedModulePathToPlatformSeparatedModulePath

        protected java.lang.StringBuilder convertSeparatedModulePathToPlatformSeparatedModulePath​(java.lang.String pluginModulePath)
        This will convert a module path separated by either : or ; into a string which uses the platform depend path separator uniformly.
        Parameters:
        pluginModulePath - The module path.
        Returns:
        The platform separated module path.
      • getPlatformDependSeparateList

        protected java.lang.String getPlatformDependSeparateList​(java.util.List<java.lang.String> modulePaths)
        Convert a list into a string which is separated by platform depend path separator.
        Parameters:
        modulePaths - The list of elements.
        Returns:
        The string which contains the elements separated by File.pathSeparatorChar.
      • getCommaSeparatedList

        protected java.lang.String getCommaSeparatedList​(java.util.List<java.lang.String> modules)
        Convert a list into a
        Parameters:
        modules - The list of modules.
        Returns:
        The string with the module list which is separated by ,.