Package org.codehaus.mojo.keytool
Class AbstractKeyToolRequestMojo<R extends KeyToolRequest>
- java.lang.Object
-
- org.apache.maven.plugin.AbstractMojo
-
- org.codehaus.mojo.keytool.AbstractKeyToolMojo
-
- org.codehaus.mojo.keytool.AbstractKeyToolRequestMojo<R>
-
- Type Parameters:
R
- generic type of request used by the mojo
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled
,org.apache.maven.plugin.Mojo
- Direct Known Subclasses:
AbstractKeyToolRequestWithKeyStoreParametersMojo
,ImportKeystoreMojo
,PrintCertificateMojo
,PrintCertificateRequestMojo
,PrintCRLFileMojo
public abstract class AbstractKeyToolRequestMojo<R extends KeyToolRequest> extends AbstractKeyToolMojo
Abstract keytool mojo implementing theKeyToolRequest
.- Since:
- 1.2
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String[]
arguments
List of additional arguments to append to the keytool command line.private KeyTool
keyTool
Keytool component.private java.lang.Class<R>
requestType
Type of keytool request used by the mojo.private org.apache.maven.execution.MavenSession
session
The current build session instance.private org.apache.maven.toolchain.ToolchainManager
toolchainManager
To obtain a toolchain if possible.private java.io.File
workingDirectory
Where to execute the keytool command.
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractKeyToolRequestMojo(java.lang.Class<R> requestType)
Constructor of abstract mojo.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
consumeResult(org.apache.maven.shared.utils.cli.javatool.JavaToolResult result)
To consume the keytool comand execution.protected R
createKeytoolRequest()
To prepare the incoming request, says fill it with mojo parameters.void
execute()
protected java.lang.String
getCommandlineInfo(org.apache.maven.shared.utils.cli.Commandline commandLine)
Gets a string representation of aCommandline
.private org.apache.maven.toolchain.Toolchain
getToolchain()
FIXME tchemit-20123-11-13, need to find out how to do this...-
Methods inherited from class org.codehaus.mojo.keytool.AbstractKeyToolMojo
getMessage, getMessage, getMessage, isSkip, isVerbose, setSkip, setVerbose
-
-
-
-
Field Detail
-
arguments
@Parameter private java.lang.String[] arguments
List of additional arguments to append to the keytool command line. Note: This parameter is left for compatibility reason but should be used at a last resort whenparameters are not found in dedicated mojo due to possible side-effects on parameters (see https://jira.codehaus.org/browse/MKEYTOOL-17)- Since:
- 1.1
-
workingDirectory
@Parameter(defaultValue="${basedir}", required=true, alias="workingdir") private java.io.File workingDirectory
Where to execute the keytool command.
-
keyTool
@Component(role=KeyTool.class) private KeyTool keyTool
Keytool component.- Since:
- 1.2
-
toolchainManager
@Component private org.apache.maven.toolchain.ToolchainManager toolchainManager
To obtain a toolchain if possible.- Since:
- 1.4
-
session
@Component private org.apache.maven.execution.MavenSession session
The current build session instance. This is used for toolchain manager API calls.- Since:
- 1.4
-
requestType
private final java.lang.Class<R extends KeyToolRequest> requestType
Type of keytool request used by the mojo.
-
-
Constructor Detail
-
AbstractKeyToolRequestMojo
protected AbstractKeyToolRequestMojo(java.lang.Class<R> requestType)
Constructor of abstract mojo.- Parameters:
requestType
- type of keytool request used by the mojo
-
-
Method Detail
-
execute
public void execute() throws org.apache.maven.plugin.MojoExecutionException
- Throws:
org.apache.maven.plugin.MojoExecutionException
-
createKeytoolRequest
protected R createKeytoolRequest()
To prepare the incoming request, says fill it with mojo parameters.- Returns:
- the created keytool request
- See Also:
KeyToolRequest
-
getCommandlineInfo
protected java.lang.String getCommandlineInfo(org.apache.maven.shared.utils.cli.Commandline commandLine)
Gets a string representation of aCommandline
.This method creates the string representation by calling
commandLine.toString()
by default.- Parameters:
commandLine
- TheCommandline
to get a string representation of (can not be null).- Returns:
- The string representation of
commandLine
.
-
consumeResult
protected final void consumeResult(org.apache.maven.shared.utils.cli.javatool.JavaToolResult result) throws org.apache.maven.plugin.MojoExecutionException
To consume the keytool comand execution.- Parameters:
result
- result of the command line action- Throws:
org.apache.maven.plugin.MojoExecutionException
- if the result is not 0 (means something bad occurs)
-
getToolchain
private org.apache.maven.toolchain.Toolchain getToolchain()
FIXME tchemit-20123-11-13, need to find out how to do this... TODO remove the part with ToolchainManager lookup once we depend on 2.0.9 (have it as prerequisite). Define as regular component field then.- Returns:
- Toolchain instance
-
-