Class AbstractJModMojo

java.lang.Object
org.apache.maven.plugin.AbstractMojo
org.apache.maven.plugins.jmod.AbstractJModMojo
All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo
Direct Known Subclasses:
JModCreateMojo, JModDescribeMojo, JModHashMojo, JModListMojo

public abstract class AbstractJModMojo extends org.apache.maven.plugin.AbstractMojo
This contains the code to handle toolchains and the execution of the command which is similar to code in maven-jlink-plugin (maven-jdeps-plugin?). Later we need to think about a way to combine that code to reduce duplication.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private Map<String,String>
    Specify the requirements for this JDK toolchain.
    private org.apache.maven.project.MavenProject
     
    private org.apache.maven.execution.MavenSession
     
    private final org.apache.maven.toolchain.ToolchainManager
     

    Fields inherited from interface org.apache.maven.plugin.Mojo

    ROLE
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    AbstractJModMojo(org.apache.maven.toolchain.ToolchainManager toolchainManager)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    executeCommand(org.apache.maven.shared.utils.cli.Commandline cmd, File outputDirectory)
     
    protected String
    Convert a list into a
    protected String
     
    org.apache.maven.project.MavenProject
     
    org.apache.maven.execution.MavenSession
     
    protected org.apache.maven.toolchain.Toolchain
     
    protected boolean
     

    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 Details

    • 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
    • jdkToolchain

      @Parameter private Map<String,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
    • toolchainManager

      private final org.apache.maven.toolchain.ToolchainManager toolchainManager
  • Constructor Details

    • AbstractJModMojo

      protected AbstractJModMojo(org.apache.maven.toolchain.ToolchainManager toolchainManager)
  • Method Details

    • getJModExecutable

      protected String getJModExecutable() throws IOException
      Throws:
      IOException
    • projectHasAlreadySetAnArtifact

      protected boolean projectHasAlreadySetAnArtifact()
    • executeCommand

      protected void executeCommand(org.apache.maven.shared.utils.cli.Commandline cmd, File outputDirectory) throws org.apache.maven.plugin.MojoExecutionException
      Throws:
      org.apache.maven.plugin.MojoExecutionException
    • getCommaSeparatedList

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

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

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

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