jar:sign

Signs a JAR using jarsigner.

Mojo Attributes:

  • Requires a Maven 2.0 project to execute.
  • Requires dependency resolution of artifacts in scope: runtime
  • Automatically executes within the lifecycle phase: package

Required Parameters

Name Type Description
alias String See options.
finalName String Name of the generated JAR (without classifier and extension).
workingDirectory File The working directory in which the jarsigner executable will be run. Default value is ${basedir}.

Optional Parameters

Name Type Description
classifier String Classifier to use for the generated artifact. If not specified, the generated artifact becomes the primary artifact.
jarPath File Path of the jar to sign. When specified, the finalName is ignored. Default value is ${project.build.directory}/${project.build.finalName}.${project.packaging}.
keypass String See options.
keystore String See options.
projectHelper MavenProjectHelper No description.
sigfile String See options.
signedjar File See options. Not specifying this argument will sign the jar in-place (your original jar is going to be overwritten).
skip boolean Set this to true to disable signing. Useful to speed up build process in development environment. Default value is false.
storepass String See options.
type String See options. The corresponding option in the command line is -storetype.
verbose boolean Enable verbose. See options. Default value is false.
verify boolean Automatically verify a jar after signing it. See options. Default value is false.

Parameter Details

alias

See options.

  • Type: java.lang.String
  • Required: Yes
  • Expression: ${alias}

classifier Classifier to use for the generated artifact. If not specified, the generated artifact becomes the primary artifact.
  • Type: java.lang.String
  • Required: No
  • Expression: ${classifier}

finalName Name of the generated JAR (without classifier and extension).
  • Type: java.lang.String
  • Required: Yes
  • Expression: ${project.build.finalName}

jarPath Path of the jar to sign. When specified, the finalName is ignored.
  • Type: java.io.File
  • Required: No
  • Default: ${project.build.directory}/${project.build.finalName}.${project.packaging}

keypass See options.
  • Type: java.lang.String
  • Required: No
  • Expression: ${keypass}

keystore See options.
  • Type: java.lang.String
  • Required: No
  • Expression: ${keystore}

projectHelper No Description.
  • Type: org.apache.maven.project.MavenProjectHelper
  • Required: No

sigfile See options.
  • Type: java.lang.String
  • Required: No
  • Expression: ${sigfile}

signedjar See options. Not specifying this argument will sign the jar in-place (your original jar is going to be overwritten).
  • Type: java.io.File
  • Required: No
  • Expression: ${signedjar}

skip Set this to true to disable signing. Useful to speed up build process in development environment.
  • Type: boolean
  • Required: No
  • Expression: ${maven.jar.sign.skip}
  • Default: false

storepass See options.
  • Type: java.lang.String
  • Required: No
  • Expression: ${storepass}

type See options. The corresponding option in the command line is -storetype.
  • Type: java.lang.String
  • Required: No
  • Expression: ${type}

verbose Enable verbose. See options.
  • Type: boolean
  • Required: No
  • Expression: ${verbose}
  • Default: false

verify Automatically verify a jar after signing it. See options.
  • Type: boolean
  • Required: No
  • Expression: ${verify}
  • Default: false

workingDirectory The working directory in which the jarsigner executable will be run.
  • Type: java.io.File
  • Required: Yes
  • Expression: ${workingdir}
  • Default: ${basedir}