Could not transfer artifact from/to central because of InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty

只谈情不闲聊 提交于 2019-12-12 14:10:31

问题


When I try to install the pom.xml of maven project, I get the following error. Please help.

Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:2.6:resources (default-resources) on project pm: Execution default-resources of goal org.apache.maven.plugins:maven-resources-plugin:2.6:resources failed: Plugin org.apache.maven.plugins:maven-resources-plugin:2.6 or one of its dependencies could not be resolved: Could not transfer artifact classworlds:classworlds:jar:1.1 from/to central (https://repo.maven.apache.org/maven2): java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty


回答1:


I had the same issue when compiling on a remote CI server. In the end, forcing the location of the trustStore when compiling with Maven solved the problem for me:

-Djavax.net.ssl.trustStore=/usr/java/jdk1.8.0_91/jre/lib/security/cacerts

The actual path will be different based on your JDK installation.

I speculate (not sure) that the problem arises if you have more than one JDK, some old one does not have proper certificate, and somehow Maven picks up that old one even if you are using the right javac



来源:https://stackoverflow.com/questions/37278306/could-not-transfer-artifact-from-to-central-because-of-invalidalgorithmparameter

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!