Could not transfer artifact from/to central because of InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty(由于 InvalidAlgorithmParameterException,无法将工件从/向中心传输:trustAnchors 参数必须非空)
问题描述
当我尝试安装 maven 项目的 pom.xml
时,出现以下错误.请帮忙.
When I try to install the pom.xml
of maven project, I get the following error. Please help.
在项目 pm 上执行目标 org.apache.maven.plugins:maven-resources-plugin:2.6:resources (default-resources) 失败:执行目标 org.apache.maven.plugins:maven-resources 的默认资源-plugin:2.6:resources failed: Plugin 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 参数必须为非空
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
推荐答案
我在远程 CI 服务器上编译时遇到了同样的问题.最后,在使用 Maven 编译时强制 trustStore 的位置为我解决了这个问题:
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
实际路径会根据您的 JDK 安装而有所不同.
The actual path will be different based on your JDK installation.
我推测(不确定)如果您有多个 JDK,某个旧的 JDK 没有正确的证书,并且即使您使用正确的 javac<,Maven 也会以某种方式拾取那个旧的/代码>
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 参数必须非空的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:由于 InvalidAlgorithmParameterException,无法将工件从/向中心传输:trustAnchors 参数必须非空


基础教程推荐
- Java 实例变量在两个语句中声明和初始化 2022-01-01
- 验证是否调用了所有 getter 方法 2022-01-01
- 多个组件的复杂布局 2022-01-01
- Java Swing计时器未清除 2022-01-01
- 不推荐使用 Api 注释的描述 2022-01-01
- 大摇大摆的枚举 2022-01-01
- 如何在 Spring @Value 注解中正确指定默认值? 2022-01-01
- 从 python 访问 JVM 2022-01-01
- 如何在 JFrame 中覆盖 windowsClosing 事件 2022-01-01
- 在 Java 中创建日期的正确方法是什么? 2022-01-01