Class AbstractJarsignerMojo

java.lang.Object
org.apache.maven.plugin.AbstractMojo
org.apache.maven.plugins.jarsigner.AbstractJarsignerMojo
All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo
Direct Known Subclasses:
JarsignerSignMojo, JarsignerVerifyMojo

public abstract class AbstractJarsignerMojo extends org.apache.maven.plugin.AbstractMojo
Maven Jarsigner Plugin base class.
Author:
Christian Schulte
  • Field Summary

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

    ROLE
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected abstract org.apache.maven.shared.jarsigner.JarSignerRequest
    Creates the jar signer request to be executed.
    protected String
    decrypt(String encoded)
     
    final void
     
    protected abstract void
    executeJarSigner(org.apache.maven.shared.jarsigner.JarSigner jarSigner, org.apache.maven.shared.jarsigner.JarSignerRequest request)
    Executes jarsigner (execute signing or verification for a jar file).
    protected String
    getCommandlineInfo(org.apache.maven.shared.utils.cli.Commandline commandLine)
    Gets a string representation of a Commandline.
     
     
    protected void
    Pre-processes a given archive.
    protected final void
    Processes a given archive.
    protected void
    Process (sign/verify) a list of archives.
    protected void
    Validate the user supplied configuration/parameters.

    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
  • Constructor Details

    • AbstractJarsignerMojo

      public AbstractJarsignerMojo()
  • Method Details

    • execute

      public final void execute() throws org.apache.maven.plugin.MojoExecutionException
      Throws:
      org.apache.maven.plugin.MojoExecutionException
    • createRequest

      protected abstract org.apache.maven.shared.jarsigner.JarSignerRequest createRequest(File archive) throws org.apache.maven.plugin.MojoExecutionException
      Creates the jar signer request to be executed.
      Parameters:
      archive - the archive file to treat by jarsigner
      Returns:
      the request
      Throws:
      org.apache.maven.plugin.MojoExecutionException - if an exception occurs
      Since:
      1.3
    • getCommandlineInfo

      protected String getCommandlineInfo(org.apache.maven.shared.utils.cli.Commandline commandLine)
      Gets a string representation of a Commandline.

      This method creates the string representation by calling commandLine.toString() by default.

      Parameters:
      commandLine - The Commandline to get a string representation of.
      Returns:
      The string representation of commandLine.
      Throws:
      NullPointerException - if commandLine is null
    • getStoretype

      public String getStoretype()
    • getStorepass

      public String getStorepass()
    • preProcessArchive

      protected void preProcessArchive(File archive) throws org.apache.maven.plugin.MojoExecutionException
      Pre-processes a given archive.
      Parameters:
      archive - The archive to process, must not be null.
      Throws:
      org.apache.maven.plugin.MojoExecutionException - if pre-processing failed
    • validateParameters

      protected void validateParameters() throws org.apache.maven.plugin.MojoExecutionException
      Validate the user supplied configuration/parameters.
      Throws:
      org.apache.maven.plugin.MojoExecutionException - if the user supplied configuration make further execution impossible
    • processArchives

      protected void processArchives(List<File> archives) throws org.apache.maven.plugin.MojoExecutionException
      Process (sign/verify) a list of archives.
      Parameters:
      archives - list of jar files to process
      Throws:
      org.apache.maven.plugin.MojoExecutionException - if an error occurs during the processing of archives
    • processArchive

      protected final void processArchive(File archive) throws org.apache.maven.plugin.MojoExecutionException
      Processes a given archive.
      Parameters:
      archive - The archive to process.
      Throws:
      NullPointerException - if archive is null
      org.apache.maven.plugin.MojoExecutionException - if processing archive fails
    • executeJarSigner

      protected abstract void executeJarSigner(org.apache.maven.shared.jarsigner.JarSigner jarSigner, org.apache.maven.shared.jarsigner.JarSignerRequest request) throws org.apache.maven.shared.utils.cli.javatool.JavaToolException, org.apache.maven.plugin.MojoExecutionException
      Executes jarsigner (execute signing or verification for a jar file).
      Parameters:
      jarSigner - the JarSigner execution interface
      request - the JarSignerRequest with parameters JarSigner should use
      Throws:
      org.apache.maven.shared.utils.cli.javatool.JavaToolException - if jarsigner could not be invoked
      org.apache.maven.plugin.MojoExecutionException - if the invocation of jarsigner succeeded, but returned a non-zero exit code
    • decrypt

      protected String decrypt(String encoded) throws org.apache.maven.plugin.MojoExecutionException
      Throws:
      org.apache.maven.plugin.MojoExecutionException