使用maven导入module时,报java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty

在新装IDEA导入Flink源码时出现一些问题,在此记录,希望能帮到大伙!


 一、环境

  IDEA2019.1.2(破解版);OpenJDK 1.8.0_40;Maven 3.5.3/3.2.5/3.6.2

二、报错现象及解决方法

  导入源码后,发现无法自动下载源码依赖,报错如下:

java.lang.RuntimeException: org.apache.maven.model.resolution.UnresolvableModelException: Failure to transfer org.apache:apache:pom:18 from http://maven.aliyun.com/nexus/content/groups/public/ was cached in the local repository, resolution will not be reattempted until the update interval of alimaven has elapsed or updates are forced. Original error: Could not transfer artifact org.apache:apache:pom:18 from/to alimaven (http://maven.aliyun.com/nexus/content/groups/public/): java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
    at org.apache.maven.project.ProjectModelResolver.resolveModel(ProjectModelResolver.java:197)
    at org.apache.maven.project.ProjectModelResolver.resolveModel(ProjectModelResolver.java:243)
    at org.apache.maven.model.building.DefaultModelBuilder.readParentExternally(DefaultModelBuilder.java:1052)
    at org.apache.maven.model.building.DefaultModelBuilder.readParent(DefaultModelBuilder.java:830)
    at org.apache.maven.model.building.DefaultModelBuilder.build(DefaultModelBuilder.java:332)
    at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:158)
    at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:116)
    at org.jetbrains.idea.maven.server.Maven3ServerEmbedder.buildSinglePom(Maven3ServerEmbedder.java:177)
    at org.jetbrains.idea.maven.server.Maven3ServerEmbedder.getProjectBuildingResults(Maven3ServerEmbedder.java:160)
    at org.jetbrains.idea.maven.server.Maven3ServerEmbedderImpl$3.run(Maven3ServerEmbedderImpl.java:663)
    at org.jetbrains.idea.maven.server.Maven3ServerEmbedderImpl.executeWithMavenSession(Maven3ServerEmbedderImpl.java:627)
    at org.jetbrains.idea.maven.server.Maven3ServerEmbedderImpl.doResolveProject(Maven3ServerEmbedderImpl.java:646)
    at org.jetbrains.idea.maven.server.Maven3ServerEmbedderImpl.resolveProject(Maven3ServerEmbedderImpl.java:580)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:323)
    at sun.rmi.transport.Transport$1.run(Transport.java:200)
    at sun.rmi.transport.Transport$1.run(Transport.java:197)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.rmi.transport.Transport.serviceCall(Transport.java:196)
    at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:568)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:826)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$254(TCPTransport.java:683)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler$$Lambda$1/8104157.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:682)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.RuntimeException: org.eclipse.aether.resolution.ArtifactResolutionException: Failure to transfer org.apache:apache:pom:18 from http://maven.aliyun.com/nexus/content/groups/public/ was cached in the local repository, resolution will not be reattempted until the update interval of alimaven has elapsed or updates are forced. Original error: Could not transfer artifact org.apache:apache:pom:18 from/to alimaven (http://maven.aliyun.com/nexus/content/groups/public/): 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:422)
    at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:224)
    at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifact(DefaultArtifactResolver.java:201)
    at org.eclipse.aether.internal.impl.DefaultRepositorySystem.resolveArtifact(DefaultRepositorySystem.java:260)
    at org.apache.maven.project.ProjectModelResolver.resolveModel(ProjectModelResolver.java:193)
    ... 30 more

   在排除是因为本地设置的问题后,猜测是Maven的问题,所以开始是各种百度,从Maven3.6.2开始向下试探,结果还是无法解决问题,后来以各种信息分析百度,还是没有解决问题。

  在其他配置不变的情况,最后采取的措施是将IDEA从2019.1.2版本降为2018.3.6即可正常导入。

三、总结

  在IDEA官网上,都没有找到对应的2019.1.2版本的下载包,就目前情况看,应该是IDEA2019.1.2版本存在某些我不知道的设置或别的情况,所以个人不推荐使用IDEA2019.1.2版本。

你可能感兴趣的:(使用maven导入module时,报java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty)