Class JarsignerSignMojo

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

@Mojo(name="sign", defaultPhase=PACKAGE, threadSafe=true) public class JarsignerSignMojo extends AbstractJarsignerMojo
Signs a project artifact and attachments using jarsigner.
Since:
1.0
Author:
Christian Schulte
  • Constructor Details

    • JarsignerSignMojo

      public JarsignerSignMojo()
  • Method Details

    • getCommandlineInfo

      protected String getCommandlineInfo(org.apache.maven.shared.utils.cli.Commandline commandLine)
      Description copied from class: AbstractJarsignerMojo
      Gets a string representation of a Commandline.

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

      Overrides:
      getCommandlineInfo in class AbstractJarsignerMojo
      Parameters:
      commandLine - The Commandline to get a string representation of.
      Returns:
      The string representation of commandLine.
    • preProcessArchive

      protected void preProcessArchive(File archive) throws org.apache.maven.plugin.MojoExecutionException
      Description copied from class: AbstractJarsignerMojo
      Pre-processes a given archive.
      Overrides:
      preProcessArchive in class AbstractJarsignerMojo
      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
      Description copied from class: AbstractJarsignerMojo
      Validate the user supplied configuration/parameters.
      Overrides:
      validateParameters in class AbstractJarsignerMojo
      Throws:
      org.apache.maven.plugin.MojoExecutionException - if the user supplied configuration make further execution impossible
    • createRequest

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

      protected void processArchives(List<File> archives) throws org.apache.maven.plugin.MojoExecutionException
      Process (sign/verify) a list of archives. Processing of files may be parallelized for increased performance.
      Overrides:
      processArchives in class AbstractJarsignerMojo
      Parameters:
      archives - list of jar files to process
      Throws:
      org.apache.maven.plugin.MojoExecutionException - if an error occurs during the processing of archives
    • executeJarSigner

      protected 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). Will retry signing up to maxTries times if it fails.
      Specified by:
      executeJarSigner in class AbstractJarsignerMojo
      Parameters:
      jarSigner - the JarSigner execution interface
      request - the JarSignerRequest with parameters JarSigner should use
      Throws:
      org.apache.maven.plugin.MojoExecutionException - if all signing attempts fail
      org.apache.maven.shared.utils.cli.javatool.JavaToolException - if jarsigner could not be invoked