We're using a private maven repository which uses a self signed SSL certificate. We've followed the guidelines from Maven official documentation, which tells you to put your CA certificate in a custom trust store, then tell maven to use it using, for example, environment variable MAVEN_OPTS
:
MAVEN_OPTS="-Xmx512m -Djavax.net.ssl.trustStore=trust.jks -Djavax.net.ssl.trustStorePassword=XXX
This indeed fixes the SSL error for accessing our private repo, but now maven can't find the certificate to access Maven Central ! It seems that providing a custom trust store automatically disables using the system certificates for public repositories.
Another very popular SO question gives a workaround, but to me disabling SSL isn't the solution.
I would expect that providing custom certificates just adds to those from the system.
We've though of adding all system trusted certificates to the custom truststore, but think it's a tedious solution.