Package org.codehaus.mojo.keytool
Class ImportCertificateMojo
- java.lang.Object
-
- org.apache.maven.plugin.AbstractMojo
-
- org.codehaus.mojo.keytool.AbstractKeyToolMojo
-
- org.codehaus.mojo.keytool.ImportCertificateMojo
-
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled,org.apache.maven.plugin.Mojo
@Mojo(name="importCertificate", threadSafe=true) public class ImportCertificateMojo extends AbstractKeyToolMojoTo 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.
- Since:
- 1.2
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.StringaliasKey alias.private java.lang.StringfileInput file name.private java.lang.StringkeypassKey password.private java.io.FilekeystoreKeystore file location.private static org.slf4j.Loggerlogprivate booleannopromptDo not prompt.private CertificateManagementServiceserviceprivate booleanskipIfAliasExistsIf value istrue, skip the import silently if the alias already exists in the keystore.private booleanskipIfExistIf value istrue, then will do nothing if keystore already exists.private java.lang.StringstorepassKeystore password.private java.lang.StringstoretypeKeystore type (e.g., "JKS", "PKCS12").private booleantrustcacertsTrust certificates from cacerts.
-
Constructor Summary
Constructors Constructor Description ImportCertificateMojo()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidexecute()-
Methods inherited from class org.codehaus.mojo.keytool.AbstractKeyToolMojo
createParentDirIfNecessary, getMessage, getMessage, getMessage, isSkip, isVerbose, setSkip, setVerbose
-
-
-
-
Field Detail
-
log
private static final org.slf4j.Logger log
-
service
@Inject private CertificateManagementService service
-
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 istrue, then will do nothing if keystore already exists.- Since:
- 1.3
-
skipIfAliasExists
@Parameter(defaultValue="false") private boolean skipIfAliasExists
If value istrue, 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 keystoreKeystore 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.
-
-