Class TruststoreMojo
- java.lang.Object
-
- org.apache.maven.plugin.AbstractMojo
-
- io.buildlogic.truststore.maven.plugin.mojo.TruststoreMojo
-
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled,org.apache.maven.plugin.Mojo
@Mojo(name="generate-truststore", defaultPhase=PRE_INTEGRATION_TEST) public class TruststoreMojo extends org.apache.maven.plugin.AbstractMojo
-
-
Field Summary
Fields Modifier and Type Field Description protected List<String>certificatesList of files with certificates to use.protected DnsResolutiondnsResolutionRelevant only when specifying 'servers'.protected intdownloadTimeoutRelevant only when specifying 'servers'.protected IncludeCertificatesincludeCertificatesRelevant only when specifying 'servers'.protected booleanincludeDefaultTruststoreSet to true to load certificates from the default truststore in either <java.home>/lib/security/jssecacerts or <java.home>/lib/security/cacerts (in this order).protected booleanretryDownloadOnFailureRelevant only when specifying 'servers'.protected CustomScryptConfigscryptConfigCustom Scrypt config.protected List<String>serversList of TLS servers to download the certificates from.protected booleanskipSet to true to skip plugin execution.protected booleantrustAllCertificatesRelevant only when specifying 'servers'.protected StringtruststoreFileTruststore filename.protected TruststoreFormattruststoreFormatOutput truststore format: JKS, JCEKS, PKCS12, BKS, UBER or BCFKS.protected StringtruststorePasswordPassword for created truststore.
-
Constructor Summary
Constructors Constructor Description TruststoreMojo()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidexecute()protected Map<String,String>getDnsMappings()protected CustomScryptConfiggetScryptConfig()protected List<Truststore>getTruststores()
-
-
-
Field Detail
-
truststoreFormat
@Parameter(property="truststore.format", defaultValue="PKCS12") protected TruststoreFormat truststoreFormatOutput truststore format: JKS, JCEKS, PKCS12, BKS, UBER or BCFKS. Default: PKCS12.
-
truststoreFile
@Parameter(property="truststore.file", required=true) protected String truststoreFileTruststore filename. Required.
-
truststorePassword
@Parameter(property="truststore.password", defaultValue="changeit") protected String truststorePasswordPassword for created truststore. Default: changeit.
-
certificates
@Parameter(property="truststore.certificates") protected List<String> certificates
List of files with certificates to use. Optional.
-
includeDefaultTruststore
@Parameter(property="truststore.includeDefaultTruststore", defaultValue="false") protected boolean includeDefaultTruststoreSet to true to load certificates from the default truststore in either <java.home>/lib/security/jssecacerts or <java.home>/lib/security/cacerts (in this order). Default: false.
-
servers
@Parameter(property="truststore.servers") protected List<String> servers
List of TLS servers to download the certificates from. Optional.
-
trustAllCertificates
@Parameter(property="truststore.trustAllCertificates", defaultValue="false") protected boolean trustAllCertificatesRelevant only when specifying 'servers'. Set to true to trust server certificate when downloading certificates. Default: false.
-
retryDownloadOnFailure
@Parameter(property="truststore.retryDownloadOnFailure", defaultValue="true") protected boolean retryDownloadOnFailureRelevant only when specifying 'servers'. Set to false to disable retry on failure when downloading certificates. Default: true.
-
downloadTimeout
@Parameter(property="truststore.downloadTimeout", defaultValue="10000") protected int downloadTimeoutRelevant only when specifying 'servers'. Timeout, in milliseconds, when downloading certificates. Setting to 0 (zero) means no timeout. Used as both connect and read timeout. Default: 10000 (10s).
-
dnsResolution
@Parameter(property="truststore.dnsResolution", defaultValue="ALL") protected DnsResolution dnsResolutionRelevant only when specifying 'servers'. DNS resolution option: SINGLE or ALL. Default: ALL. Set to SINGLE to download certificates from a single IP address the hostname resolves to. Set to ALL to download certificates from all IP addresses the hostname resolves to. Relevant when DNS is configured to resolve given hostname to more than one IP address, and different servers might be configured to use different X.509 certificates.
-
includeCertificates
@Parameter(property="truststore.includeCertificates", defaultValue="ALL") protected IncludeCertificates includeCertificatesRelevant only when specifying 'servers'. Which certificates to download: ALL, LEAF, CA. Default: ALL.
-
scryptConfig
@Parameter protected CustomScryptConfig scryptConfig
Custom Scrypt config. Can be optionally specified when 'truststoreFormat' is set to BCFKS. Ignored if specified for other types of truststores.
-
skip
@Parameter(property="truststore.skip", defaultValue="false") protected boolean skipSet to true to skip plugin execution. Default: false.
-
-
Method Detail
-
execute
public void execute() throws org.apache.maven.plugin.MojoExecutionException- Throws:
org.apache.maven.plugin.MojoExecutionException
-
getTruststores
protected List<Truststore> getTruststores()
-
getScryptConfig
protected CustomScryptConfig getScryptConfig()
-
-