keytool:importCertificate
Full name:
org.codehaus.mojo:keytool-maven-plugin:2.0.2:importCertificate
Description:
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.
Attributes:
- Requires a Maven project to be executed.
- The goal is thread-safe and supports parallel builds.
- Since version:
1.2.
Required Parameters
| Name | Type | Since | Description |
|---|---|---|---|
<alias> |
String |
- |
Key alias. |
<keystore> |
File |
- |
Keystore file location. Default: ${project.build.directory}/keystore |
Optional Parameters
| Name | Type | Since | Description |
|---|---|---|---|
<file> |
String |
1.2 |
Input file name. See options. |
<keypass> |
String |
1.2 |
Key password. See options. |
<noprompt> |
boolean |
1.2 |
Do not prompt. See options. |
<skip> |
boolean |
1.1 |
Set to true to disable the plugin.Default: false |
<skipIfAliasExists> |
boolean |
1.8 |
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.Default: false |
<skipIfExist> |
boolean |
1.3 |
If value is true, then will do nothing if keystore already exists. |
<storepass> |
String |
- |
Keystore password. |
<storetype> |
String |
- |
Keystore type (e.g., "JKS", "PKCS12"). |
<trustcacerts> |
boolean |
1.2 |
Trust certificates from cacerts. See options. |
<verbose> |
boolean |
- |
Enable verbose mode (in mojo and in keytool command). See keytool options. Default: false |
Parameter Details
<alias>
Key alias.
- Type:
java.lang.String - Required:
Yes
<file>
Input file name. See options.
- Type:
java.lang.String - Since:
1.2 - Required:
No
<keypass>
Key password. See options.
- Type:
java.lang.String - Since:
1.2 - Required:
No
<keystore>
Keystore file location.
- Type:
java.io.File - Required:
Yes - Default:
${project.build.directory}/keystore
<noprompt>
Do not prompt. See options.
- Type:
boolean - Since:
1.2 - Required:
No
<skip>
Set to
true to disable the plugin.- Type:
boolean - Since:
1.1 - Required:
No - Default:
false
<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.- Type:
boolean - Since:
1.8 - Required:
No - Default:
false
<skipIfExist>
If value is
true, then will do nothing if keystore already exists.- Type:
boolean - Since:
1.3 - Required:
No
<storepass>
Keystore password.
- Type:
java.lang.String - Required:
No
<storetype>
Keystore type (e.g., "JKS", "PKCS12").
- Type:
java.lang.String - Required:
No
<trustcacerts>
Trust certificates from cacerts. See options.
- Type:
boolean - Since:
1.2 - Required:
No
<verbose>
Enable verbose mode (in mojo and in keytool command). See keytool options.
- Type:
boolean - Required:
No - Default:
false

