由于InvalidAlgorithmParameterException,无法从中央/向中央传输工件:trustAnchors参数必须为非空 [英] Could not transfer artifact from/to central because of InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty

查看:131
本文介绍了由于InvalidAlgorithmParameterException,无法从中央/向中央传输工件:trustAnchors参数必须为非空的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试安装maven项目的pom.xml时,出现以下错误.请帮忙.

无法在项目pm上执行目标org.apache.maven.plugins:maven-resources-plugin:2.6:resources(default-resources):执行目标org.apache.maven.plugins:maven-resources的默认资源-plugin:2.6:resources失败:无法解析插件org.apache.maven.plugins:maven-resources-plugin:2.6或其依赖项之一:无法从/到中心转移工件classworlds:classworlds:jar:1.1( https://repo.maven.apache.org/maven2 ):java.lang.RuntimeException:意外错误:java.security.InvalidAlgorithmParameterException:trustAnchors参数必须为非空

解决方案

在远程CI服务器上进行编译时,我遇到了同样的问题.最后,在用Maven编译时强制trustStore的位置为我解决了这个问题:

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

实际路径将根据您的JDK安装而有所不同.

我推测(不确定)如果您有多个JDK,一些旧的JDK没有适当的证书,并且即使您使用的是正确的javac,Maven也会选择那个旧的JDK会出现问题

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

解决方案

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

这篇关于由于InvalidAlgorithmParameterException,无法从中央/向中央传输工件:trustAnchors参数必须为非空的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆