Class AbstractKeyToolRequestMojo<R extends KeyToolRequest>

    • 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.
      • Fields inherited from interface org.apache.maven.plugin.Mojo

        ROLE
    • 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 a Commandline.
      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.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
    • 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.
      • 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 a Commandline.

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

        Parameters:
        commandLine - The Commandline 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