Class AbstractToolMojo

java.lang.Object
org.apache.maven.plugin.AbstractMojo
net.agilhard.maven.plugins.jpacktool.base.mojo.AbstractToolMojo
All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo
Direct Known Subclasses:
AbstractDependencyJarsMojo, AbstractTemplateToolMojo

public abstract class AbstractToolMojo
extends org.apache.maven.plugin.AbstractMojo
Author:
bei
  • Field Details

    • buildDirectory

      @Parameter(defaultValue="${project.build.directory}", required=true, readonly=true) protected java.io.File buildDirectory
    • outputDirectoryJPacktool

      @Parameter(defaultValue="${project.build.directory}/jpacktool", required=true, readonly=true) protected java.io.File outputDirectoryJPacktool
    • outputDirectoryAutomaticJars

      @Parameter(defaultValue="${project.build.directory}/jpacktool/autojar", required=true, readonly=true) protected java.io.File outputDirectoryAutomaticJars
    • outputDirectoryClasspathJars

      @Parameter(defaultValue="${project.build.directory}/jpacktool/jar", required=true, readonly=true) protected java.io.File outputDirectoryClasspathJars
    • outputDirectoryModules

      @Parameter(defaultValue="${project.build.directory}/jpacktool/jmods", required=true, readonly=true) protected java.io.File outputDirectoryModules
    • jpacktoolPropertyPrefix

      @Parameter(defaultValue="jpacktool", required=true, readonly=true) protected java.lang.String jpacktoolPropertyPrefix
    • excludedArtifacts

      @Parameter protected java.util.List<ArtifactParameter> excludedArtifacts
      Artifacts that should be excluded
    • classpathArtifacts

      @Parameter protected java.util.List<ArtifactParameter> classpathArtifacts
      Artifacts that should be explicitly on the classpath
    • locationManager

      @Component protected org.codehaus.plexus.languages.java.jpms.LocationManager locationManager
    • toolchainManager

      @Component protected org.apache.maven.toolchain.ToolchainManager toolchainManager
    • zipArchiver

      @Component(role=org.codehaus.plexus.archiver.Archiver.class, hint="zip") protected org.codehaus.plexus.archiver.zip.ZipArchiver zipArchiver
      The JAR archiver needed for archiving the environments.
    • mavenProjectHelper

      @Component protected org.apache.maven.project.MavenProjectHelper mavenProjectHelper
      The MavenProjectHelper
    • project

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

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

      protected java.util.List<java.lang.String> systemModules
    • verbose

      @Parameter(defaultValue="false") protected boolean verbose
      This will turn on verbose mode.

      The jlink/jpackager command line equivalent is: --verbose

    • @Parameter(defaultValue="false") protected boolean skip
      skip plugin execution.
    • jdkToolchain

      @Parameter protected 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
    • javaVersion

      protected double javaVersion
    • shouldSkipReason

      protected java.lang.String shouldSkipReason
    • jpacktoolModel

      protected java.util.Map<java.lang.String,​java.lang.Object> jpacktoolModel
    • templateMap

      protected java.util.Map<java.lang.String,​java.lang.Object> templateMap
  • Constructor Details

  • Method Details

    • execute

      public void execute() throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException
      Throws:
      org.apache.maven.plugin.MojoExecutionException
      org.apache.maven.plugin.MojoFailureException
    • executeToolStart

      public void executeToolStart() throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException
      Throws:
      org.apache.maven.plugin.MojoExecutionException
      org.apache.maven.plugin.MojoFailureException
    • executeToolMain

      public abstract void executeToolMain() throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException
      Throws:
      org.apache.maven.plugin.MojoExecutionException
      org.apache.maven.plugin.MojoFailureException
    • executeToolFinish

      public void executeToolFinish() throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException
      Throws:
      org.apache.maven.plugin.MojoExecutionException
      org.apache.maven.plugin.MojoFailureException
    • getPluginVersion

      public java.lang.String getPluginVersion() throws org.apache.maven.plugin.MojoFailureException
      Throws:
      org.apache.maven.plugin.MojoFailureException
    • checkShouldSkip

      public void checkShouldSkip()
    • getShouldSkipReason

      public java.lang.String getShouldSkipReason()
    • setShouldSkipReason

      public void setShouldSkipReason​(java.lang.String shouldSkipReason)
    • getJavaVersion

      public double getJavaVersion()
    • getToolExecutable

      protected java.lang.String getToolExecutable​(java.lang.String toolName) throws java.io.IOException
      Throws:
      java.io.IOException
    • executeCommand

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

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

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

      public org.apache.maven.execution.MavenSession getSession()
    • getOutputDirectoryJPacktool

      public java.io.File getOutputDirectoryJPacktool()
    • getOutputDirectoryAutomaticJars

      public java.io.File getOutputDirectoryAutomaticJars()
    • getOutputDirectoryClasspathJars

      public java.io.File getOutputDirectoryClasspathJars()
    • getOutputDirectoryModules

      public java.io.File getOutputDirectoryModules()
    • getJpacktoolPropertyPrefix

      public java.lang.String getJpacktoolPropertyPrefix()
    • getExcludedArtifacts

      public java.util.List<ArtifactParameter> getExcludedArtifacts()
    • getClasspathArtifacts

      public java.util.List<ArtifactParameter> getClasspathArtifacts()
    • getLocationManager

      public org.codehaus.plexus.languages.java.jpms.LocationManager getLocationManager()
    • getToolchainManager

      public org.apache.maven.toolchain.ToolchainManager getToolchainManager()
    • isVerbose

      public boolean isVerbose()
    • getJdkToolchain

      public java.util.Map<java.lang.String,​java.lang.String> getJdkToolchain()
    • getSystemModules

      public java.util.List<java.lang.String> getSystemModules() throws org.apache.maven.plugin.MojoExecutionException
      Throws:
      org.apache.maven.plugin.MojoExecutionException
    • getArtifactFile

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

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

      protected void publishJPacktoolProperties()
    • bytesToHex

      protected static java.lang.String bytesToHex​(byte[] hash)
    • publishSHA256

      public void publishSHA256​(java.io.File file) throws org.apache.maven.plugin.MojoFailureException
      Throws:
      org.apache.maven.plugin.MojoFailureException
    • createZipArchiveFromDirectory

      protected java.io.File createZipArchiveFromDirectory​(java.io.File outputDirectory, java.io.File outputDirectoryToZip) throws org.apache.maven.plugin.MojoExecutionException
      Throws:
      org.apache.maven.plugin.MojoExecutionException
    • getFinalName

      public java.lang.String getFinalName()