Class ImportCertificateMojo

  • All Implemented Interfaces:
    org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo

    @Mojo(name="importCertificate",
          threadSafe=true)
    public class ImportCertificateMojo
    extends AbstractKeyToolMojo
    To import a certificate into a keystore using Java KeyStore API.

    This Mojo has been refactored to use Java's KeyStore API directly instead of executing external keytool command, providing better performance and error handling.

    See keytool documentation.

    Since:
    1.2
    • Field Detail

      • log

        private static final org.slf4j.Logger log
      • keypass

        @Parameter
        private java.lang.String keypass
        Key password. See options.
        Since:
        1.2
      • file

        @Parameter
        private java.lang.String file
        Input file name. See options.
        Since:
        1.2
      • noprompt

        @Parameter
        private boolean noprompt
        Do not prompt. See options.
        Since:
        1.2
      • trustcacerts

        @Parameter
        private boolean trustcacerts
        Trust certificates from cacerts. See options.
        Since:
        1.2
      • skipIfExist

        @Parameter
        private boolean skipIfExist
        If value is true, then will do nothing if keystore already exists.
        Since:
        1.3
      • skipIfAliasExists

        @Parameter(defaultValue="false")
        private boolean skipIfAliasExists
        If value is true, skip the import silently if the alias already exists in the keystore. This is useful when running multiple executions without clean, allowing idempotent builds.
        Since:
        1.8
      • keystore

        @Parameter(defaultValue="${project.build.directory}/keystore",
                   required=true)
        private java.io.File keystore
        Keystore file location.
      • storetype

        @Parameter
        private java.lang.String storetype
        Keystore type (e.g., "JKS", "PKCS12").
      • storepass

        @Parameter
        private java.lang.String storepass
        Keystore password.
      • alias

        @Parameter(required=true)
        private java.lang.String alias
        Key alias.
    • Constructor Detail

      • ImportCertificateMojo

        public ImportCertificateMojo()
    • Method Detail

      • execute

        public void execute()
                     throws org.apache.maven.plugin.MojoExecutionException
        Throws:
        org.apache.maven.plugin.MojoExecutionException