public abstract class AbstractJarsignerMojo
extends org.apache.maven.plugin.AbstractMojo
Modifier and Type | Field and Description |
---|---|
private java.lang.String |
alias
See options.
|
private java.io.File |
archive
Archive to process.
|
private java.io.File |
archiveDirectory
The base directory to scan for JAR files using Ant-like inclusion/exclusion patterns.
|
private java.lang.String[] |
arguments
List of additional arguments to append to the jarsigner command line.
|
private java.lang.Boolean |
attachments
Deprecated.
As of version 1.1 in favor of the new parameter
processAttachedArtifacts . |
private java.lang.String[] |
excludeClassifiers
A set of artifact classifiers describing the project attachments that should not be processed.
|
private java.lang.String[] |
excludes
The Ant-like exclusion patterns used to exclude JAR files from processing.
|
private java.lang.String[] |
includeClassifiers
A set of artifact classifiers describing the project attachments that should be processed.
|
private java.lang.String[] |
includes
The Ant-like inclusion patterns used to select JAR files to process.
|
private org.apache.maven.shared.jarsigner.JarSigner |
jarSigner |
private java.lang.String |
keystore
See options.
|
private java.lang.String |
maxMemory
The maximum memory available to the JAR signer, e.g.
|
private boolean |
processAttachedArtifacts
Controls processing of project attachments.
|
private boolean |
processMainArtifact
Controls processing of the main artifact produced by the project.
|
private org.apache.maven.project.MavenProject |
project
The Maven project.
|
private boolean |
protectedAuthenticationPath
Must be set to true if the password must be given via a protected
authentication path such as a dedicated PIN reader.
|
private java.lang.String |
providerArg
See options.
|
private java.lang.String |
providerClass
See options.
|
private java.lang.String |
providerName
See options.
|
private org.sonatype.plexus.components.sec.dispatcher.SecDispatcher |
securityDispatcher |
private org.apache.maven.execution.MavenSession |
session
The current build session instance.
|
private boolean |
skip
Set to
true to disable the plugin. |
private java.lang.String |
storepass
See options.
|
private java.lang.String |
storetype
See options.
|
private org.apache.maven.toolchain.ToolchainManager |
toolchainManager
To obtain a toolchain if possible.
|
private boolean |
verbose
See options.
|
private java.io.File |
workingDirectory
Location of the working directory.
|
Constructor and Description |
---|
AbstractJarsignerMojo() |
Modifier and Type | Method and Description |
---|---|
protected abstract org.apache.maven.shared.jarsigner.JarSignerRequest |
createRequest(java.io.File archive)
Creates the jar signer request to be executed.
|
protected java.lang.String |
decrypt(java.lang.String encoded) |
void |
execute() |
protected java.lang.String |
getCommandlineInfo(org.apache.maven.shared.utils.cli.Commandline commandLine)
Gets a string representation of a
Commandline . |
private java.lang.String |
getMessage(java.lang.String key) |
(package private) java.lang.String |
getMessage(java.lang.String key,
java.lang.Object arg) |
private java.lang.String |
getMessage(java.lang.String key,
java.lang.Object[] args)
Gets a message for a given key from the resource bundle backing the implementation.
|
private java.lang.String |
getMessage(java.lang.String key,
java.lang.Object arg1,
java.lang.Object arg2) |
java.lang.String |
getStorepass() |
java.lang.String |
getStoretype() |
private org.apache.maven.toolchain.Toolchain |
getToolchain()
FIXME tchemit-20123-11-13, need to find out how to do this...
|
private boolean |
isZipFile(org.apache.maven.artifact.Artifact artifact)
Checks whether the specified artifact is a ZIP file.
|
protected void |
preProcessArchive(java.io.File archive)
Pre-processes a given archive.
|
private void |
processArchive(java.io.File archive)
Processes a given archive.
|
private boolean |
processArtifact(org.apache.maven.artifact.Artifact artifact)
Processes a given artifact.
|
@Parameter(property="jarsigner.verbose", defaultValue="false") private boolean verbose
@Parameter(property="jarsigner.keystore") private java.lang.String keystore
@Parameter(property="jarsigner.storetype") private java.lang.String storetype
@Parameter(property="jarsigner.storepass") private java.lang.String storepass
@Parameter(property="jarsigner.providerName") private java.lang.String providerName
@Parameter(property="jarsigner.providerClass") private java.lang.String providerClass
@Parameter(property="jarsigner.providerArg") private java.lang.String providerArg
@Parameter(property="jarsigner.alias") private java.lang.String alias
@Parameter(property="jarsigner.maxMemory") private java.lang.String maxMemory
256M
. See -Xmx for more details.@Parameter(property="jarsigner.archive") private java.io.File archive
@Parameter(property="jarsigner.archiveDirectory") private java.io.File archiveDirectory
@Parameter private java.lang.String[] includes
archiveDirectory
. By default, the pattern
**/*.?ar
is used.@Parameter private java.lang.String[] excludes
archiveDirectory
.@Parameter(property="jarsigner.arguments") private java.lang.String[] arguments
@Parameter(property="jarsigner.skip", defaultValue="false") private boolean skip
true
to disable the plugin.@Parameter(property="jarsigner.processMainArtifact", defaultValue="true") private boolean processMainArtifact
@Parameter(property="jarsigner.processAttachedArtifacts", defaultValue="true") private boolean processAttachedArtifacts
@Parameter(property="jarsigner.protectedAuthenticationPath", defaultValue="false") private boolean protectedAuthenticationPath
@Parameter(property="jarsigner.attachments") private java.lang.Boolean attachments
processAttachedArtifacts
.@Parameter private java.lang.String[] includeClassifiers
processAttachedArtifacts
is true
. If empty, all attachments are included.@Parameter private java.lang.String[] excludeClassifiers
processAttachedArtifacts
is true
. If empty, no attachments are excluded.@Parameter(defaultValue="${project}", readonly=true, required=true) private org.apache.maven.project.MavenProject project
@Parameter(defaultValue="${project.basedir}") private java.io.File workingDirectory
@Component private org.apache.maven.shared.jarsigner.JarSigner jarSigner
@Parameter(defaultValue="${session}", readonly=true, required=true) private org.apache.maven.execution.MavenSession session
@Component private org.apache.maven.toolchain.ToolchainManager toolchainManager
@Component(hint="mng-4384") private org.sonatype.plexus.components.sec.dispatcher.SecDispatcher securityDispatcher
public final void execute() throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionException
protected abstract org.apache.maven.shared.jarsigner.JarSignerRequest createRequest(java.io.File archive) throws org.apache.maven.plugin.MojoExecutionException
archive
- the archive file to treat by jarsignerorg.apache.maven.plugin.MojoExecutionException
protected java.lang.String getCommandlineInfo(org.apache.maven.shared.utils.cli.Commandline commandLine)
Commandline
.
This method creates the string representation by calling commandLine.toString()
by default.
commandLine
- The Commandline
to get a string representation of.commandLine
.java.lang.NullPointerException
- if commandLine
is null
.public java.lang.String getStoretype()
public java.lang.String getStorepass()
private boolean isZipFile(org.apache.maven.artifact.Artifact artifact)
artifact
- The artifact to check, may be null
.true
if the artifact looks like a ZIP file, false
otherwise.private boolean processArtifact(org.apache.maven.artifact.Artifact artifact) throws org.apache.maven.plugin.MojoExecutionException
artifact
- The artifact to process.true
if the artifact is a JAR and was processed, false
otherwise.java.lang.NullPointerException
- if artifact
is null
.org.apache.maven.plugin.MojoExecutionException
- if processing artifact
fails.protected void preProcessArchive(java.io.File archive) throws org.apache.maven.plugin.MojoExecutionException
archive
- The archive to process, must not be null
.org.apache.maven.plugin.MojoExecutionException
- If pre-processing failed.private void processArchive(java.io.File archive) throws org.apache.maven.plugin.MojoExecutionException
archive
- The archive to process.java.lang.NullPointerException
- if archive
is null
.org.apache.maven.plugin.MojoExecutionException
- if processing archive
fails.protected java.lang.String decrypt(java.lang.String encoded) throws org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoExecutionException
private java.lang.String getMessage(java.lang.String key, java.lang.Object[] args)
key
- The key of the message to return.args
- Arguments to format the message with or null
.key
from the resource bundle backing the implementation.java.lang.NullPointerException
- if key
is null
.java.util.MissingResourceException
- if there is no message available matching key
or accessing
the resource bundle fails.private java.lang.String getMessage(java.lang.String key)
java.lang.String getMessage(java.lang.String key, java.lang.Object arg)
private java.lang.String getMessage(java.lang.String key, java.lang.Object arg1, java.lang.Object arg2)
private org.apache.maven.toolchain.Toolchain getToolchain()