当前位置: 首页 > 知识库问答 >
问题:

maven不下载依赖项,因为Trust Anchors参数必须为非空

慕容聪
2023-03-14

在任何人结束这个问题或标记为重复之前,我必须说我已经研究了所有的互联网,没有发现任何类似的问题。

问题是我在Virtual Box映像中安装了一个新的Linux Mint 19。因此,在安装 Java 8 之后,我下载了 Eclipse Scala,我尝试添加到新项目中的任何依赖项都不会被下载,并且在其 pom 中标记了一个错误.xml .

在检查url并在我的Eclipse Scala for Windows(在主机中)上执行完全相同的操作后,它可以工作,但在Linux上不行。

我认为这应该是一个日食错误,因为它与证书有关。

如果有帮助,我正在尝试编写一些 Apache Flink 程序,但无法通过此错误做到这一点......

我附上错误:

Failed to read artifact descriptor for org.apache.flink:flink-scala_2.11:jar:1.6.0

org.eclipse.aether.resolution.ArtifactDescriptorException: Failed to read artifact descriptor for org.apache.flink:flink-scala_2.11:jar:1.6.0
    at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.loadPom(DefaultArtifactDescriptorReader.java:282)
    at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.readArtifactDescriptor(DefaultArtifactDescriptorReader.java:198)
    at org.eclipse.aether.internal.impl.DefaultDependencyCollector.resolveCachedArtifactDescriptor(DefaultDependencyCollector.java:535)
    at org.eclipse.aether.internal.impl.DefaultDependencyCollector.getArtifactDescriptorResult(DefaultDependencyCollector.java:519)
    at org.eclipse.aether.internal.impl.DefaultDependencyCollector.processDependency(DefaultDependencyCollector.java:409)
    at org.eclipse.aether.internal.impl.DefaultDependencyCollector.processDependency(DefaultDependencyCollector.java:363)
    at org.eclipse.aether.internal.impl.DefaultDependencyCollector.process(DefaultDependencyCollector.java:351)
    at org.eclipse.aether.internal.impl.DefaultDependencyCollector.collectDependencies(DefaultDependencyCollector.java:254)
    at org.eclipse.aether.internal.impl.DefaultRepositorySystem.collectDependencies(DefaultRepositorySystem.java:316)
    at org.apache.maven.project.DefaultProjectDependenciesResolver.resolve(DefaultProjectDependenciesResolver.java:172)
    at org.apache.maven.project.DefaultProjectBuilder.resolveDependencies(DefaultProjectBuilder.java:215)
    at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:188)
    at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:119)
    at org.eclipse.m2e.core.internal.embedder.MavenImpl.readMavenProject(MavenImpl.java:636)
    at org.eclipse.m2e.core.internal.project.registry.DefaultMavenDependencyResolver.resolveProjectDependencies(DefaultMavenDependencyResolver.java:63)
    at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager.refreshPhase2(ProjectRegistryManager.java:530)
    at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager$3.call(ProjectRegistryManager.java:492)
    at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager$3.call(ProjectRegistryManager.java:1)
    at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:177)
    at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:151)
    at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager.refresh(ProjectRegistryManager.java:496)
    at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager.refresh(ProjectRegistryManager.java:351)
    at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager.refresh(ProjectRegistryManager.java:298)
    at org.eclipse.m2e.core.internal.project.ProjectConfigurationManager.updateProjectConfiguration0(ProjectConfigurationManager.java:405)
    at org.eclipse.m2e.core.internal.project.ProjectConfigurationManager$2.call(ProjectConfigurationManager.java:352)
    at org.eclipse.m2e.core.internal.project.ProjectConfigurationManager$2.call(ProjectConfigurationManager.java:1)
    at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:177)
    at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:151)
    at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:99)
    at org.eclipse.m2e.core.internal.embedder.MavenImpl.execute(MavenImpl.java:1351)
    at org.eclipse.m2e.core.internal.project.ProjectConfigurationManager.updateProjectConfiguration(ProjectConfigurationManager.java:349)
    at org.eclipse.m2e.core.ui.internal.UpdateMavenProjectJob.runInWorkspace(UpdateMavenProjectJob.java:77)
    at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:39)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:56)
Caused by: org.eclipse.aether.resolution.ArtifactResolutionException: Could not transfer artifact org.apache.flink:flink-scala_2.11:pom:1.6.0 from/to central (https://repo.maven.apache.org/maven2): java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
    at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:444)
    at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:246)
    at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifact(DefaultArtifactResolver.java:223)
    at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.loadPom(DefaultArtifactDescriptorReader.java:267)
    ... 33 more
Caused by: org.eclipse.aether.transfer.ArtifactTransferException: Could not transfer artifact org.apache.flink:flink-scala_2.11:pom:1.6.0 from/to central (https://repo.maven.apache.org/maven2): java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
    at io.takari.aether.connector.AetherRepositoryConnector$2.wrap(AetherRepositoryConnector.java:895)
    at io.takari.aether.connector.AetherRepositoryConnector$2.wrap(AetherRepositoryConnector.java:1)
    at io.takari.aether.connector.AetherRepositoryConnector$GetTask.flush(AetherRepositoryConnector.java:673)
    at io.takari.aether.connector.AetherRepositoryConnector.get(AetherRepositoryConnector.java:310)
    at org.eclipse.aether.internal.impl.DefaultArtifactResolver.performDownloads(DefaultArtifactResolver.java:520)
    at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:421)
    ... 36 more
Caused by: javax.net.ssl.SSLException: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
    at sun.security.ssl.Alerts.getSSLException(Alerts.java:208)
    at sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1964)
    at sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1921)
    at sun.security.ssl.SSLSocketImpl.handleException(SSLSocketImpl.java:1904)
    at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1420)
    at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1397)
    at okhttp3.internal.connection.RealConnection.connectTls(RealConnection.java:268)
    at okhttp3.internal.connection.RealConnection.establishProtocol(RealConnection.java:238)
    at okhttp3.internal.connection.RealConnection.connect(RealConnection.java:149)
    at okhttp3.internal.connection.StreamAllocation.findConnection(StreamAllocation.java:192)
    at okhttp3.internal.connection.StreamAllocation.findHealthyConnection(StreamAllocation.java:121)
    at okhttp3.internal.connection.StreamAllocation.newStream(StreamAllocation.java:100)
    at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:42)
    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
    at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:93)
    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
    at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93)
    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
    at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:120)
    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
    at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:185)
    at okhttp3.RealCall.execute(RealCall.java:69)
    at io.takari.aether.okhttp.OkHttpAetherClient.execute(OkHttpAetherClient.java:207)
    at io.takari.aether.okhttp.OkHttpAetherClient.get(OkHttpAetherClient.java:153)
    at io.takari.aether.connector.AetherRepositoryConnector$GetTask.resumableGet(AetherRepositoryConnector.java:600)
    at io.takari.aether.connector.AetherRepositoryConnector$GetTask.run(AetherRepositoryConnector.java:453)
    at io.takari.aether.connector.AetherRepositoryConnector.get(AetherRepositoryConnector.java:304)
    ... 38 more
Caused by: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
    at sun.security.validator.PKIXValidator.<init>(PKIXValidator.java:91)
    at sun.security.validator.Validator.getInstance(Validator.java:181)
    at sun.security.ssl.X509TrustManagerImpl.getValidator(X509TrustManagerImpl.java:312)
    at sun.security.ssl.X509TrustManagerImpl.checkTrustedInit(X509TrustManagerImpl.java:171)
    at sun.security.ssl.X509TrustManagerImpl.checkTrusted(X509TrustManagerImpl.java:184)
    at sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:124)
    at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1596)
    at sun.security.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:216)
    at sun.security.ssl.Handshaker.processLoop(Handshaker.java:1052)
    at sun.security.ssl.Handshaker.process_record(Handshaker.java:987)
    at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1072)
    at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1385)
    at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1413)
    ... 63 more
Caused by: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
    at java.security.cert.PKIXParameters.setTrustAnchors(PKIXParameters.java:200)
    at java.security.cert.PKIXParameters.<init>(PKIXParameters.java:120)
    at java.security.cert.PKIXBuilderParameters.<init>(PKIXBuilderParameters.java:104)
    at sun.security.validator.PKIXValidator.<init>(PKIXValidator.java:89)
    ... 75 more

编辑:只是一些语法和清晰度

共有1个答案

蒋俊人
2023-03-14

我通过删除安装的旧Openjdk解决了这个问题。

正如用户arcuri82在这个问题中所说:

我推测(不确定),如果您有不止一个JDK,某个旧的没有适当的证书,那么即使您使用的是正确的javac,Maven也会选择那个旧的

所以我试了一下,成功了。我希望它可以帮助其他面临这个问题的人。

 类似资料:
  • 问题内容: 我正在尝试在Jenkins / Hudson上配置我的电子邮件,并且不断收到错误消息: 我已经在网上看到了大量有关该错误的信息,但是我没有得到任何帮助。我在Fedora Linux(不是OpenJDK)上使用Sun的JDK。 这是我尝试过的一些方法。我试着从以下这个建议后,但复制从Windows的cacerts到托管詹金斯没有工作,我的Fedora箱。我尝试按照本指南进行操作,因为我试

  • 当我尝试安装maven项目的时,我得到以下错误。请帮助。 无法执行目标org.apache.maven.plugins:maven-resources-plugin:2.6:项目pm上的资源(default-资源):目标org.apache.maven.plugins的执行default-资源:maven-resources-plugin:2.6:资源失败:插件org.apache.maven.p

  • 问题内容: 当您用Google搜索以下异常:时,会显示多个结果。但是,没有确切的解决方案,只有猜测。 当我尝试使用通过SSL的开放连接时,就会出现问题(至少在我看来)。它在我的Windows机器上可以正常工作,但是当我将其部署到linux机器(安装了sun的jre)时,它会失败,并带有上述异常。 问题在于,由于某种原因,JRE的默认信任库为空(大小仅为32字节,而在Windows上为80kb)。

  • 我有一个spring boot应用程序(在HTTPS上运行,但在自签名证书上运行)。它使用JDK1.8(不是开放式JDK),我写了一段代码,其中我的代码涉及第三方API。早些时候,我的代码还在工作。但对于其他一些任务,我必须导入公司提供的证书来进行应用。为此,我将密钥库从JKS更改为PCKS12标准。 现在,在更改密钥库(我这样做是为了使用公司提供的证书启用我的应用程序HTTPS)后,我的代码在第

  • 问题内容: 我创建了一个非常简单的默认应用程序,用于在Windows 7计算机上测试Eclipse Indigo / Maven v3.0.1设置。Hello World应用程序可以从Eclipse正常运行。 现在从命令行尝试进行测试。 在这一点上,我看到Maven下载了大量的依赖项。出于某种原因,尽管下载它会停滞不前,但只会部分停止。每次都不在同一时间,但是当前始终是相同的jar文件,例如… h

  • 问题内容: 我需要将我们的maven build java项目发布给远程质量检查团队。为此,我想下载所有依赖项,并发送给他们,这样他们就不需要下载它们了。 当前,所有依赖项都在pom.xml文件中定义,并且我们使用mvn install或mvn包来构建项目。一些项目成员使用uber jars,其他一些项目则使用jars +依赖项来执行。 什么是最简单的方法来预打包相关的jar文件,以使从Inter