当我运行时
mvn clean install -Djavax.net.debug=ssl
我得到信任库路径为
信任商店是:/home/user/Downloads/jdk8/openjdk-8u40-b25-linux-x64-10_feb_2015/java-se-8u40-ri/jre/lib/security/cacerts
但这是一条错误的道路,最终给了我这个错误
Failed to read artifact descriptor for org.springframework.statemachine:spring-statemachine-core:jar:
2.1.3.RELEASE: Could not transfer artifact org.springframework.statemachine:spring-statemachine-core:
pom:2.1.3.RELEASE from/to central (https://repo.maven.apache.org/maven2): java.lang.RuntimeException:
Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
那么如何更改默认信任库的路径呢?
我正在运行 Ubuntu 18.04 和 OpenJDK 8
尝试
-Djavax.net.ssl.trustStore=/real-path/cacerts -Djavax.net.ssl.trustStorePassword=changeit -Djavax.net.ssl.trustStoreType=jks
如下所述: https://docs.oracle.com/javase/8/docs/technotes/guides/troubleshoot/envvars002.html,您还可以导出/设置环境变量:
JAVA_TOOL_OPTIONS="-Djavax.net.ssl.trustStore=/real-path/cacerts -Djavax.net.ssl.trustStorePassword=changeit -Djavax.net.ssl.trustStoreType=jks"