当我试图构建我的项目时,我得到了以下错误:
Failed to collect dependencies at org.msgpack:jackson-dataformat-msgpack:jar:0.8.17 -> com.fasterxml.jackson.core:jackson-databind:jar:2.9.9: Failed to read artifact descriptor for com.fasterxml.jackson.core:jackson-databind:jar:2.9.9: Could not transfer artifact com.fasterxml.jackson.core:jackson-databind:pom:2.9.9 from/to maven (https://repo1.maven.org/maven2): sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
我读到问题出在http://repo1.maven.org/maven2上,我需要把它改成https。这样做了,它仍然不能工作。然后,我在google ->中发现了另一个建议,用keytool & restart添加maven证书。做到了。还是不管用。请一位同事把他们的repo发送给我,它起作用了(ofc,有所有的依赖项)。然后我想在我们的junit测试中引入类别,所以我添加了surefire插件,这次的问题是类似的:
Unable to generate classpath: org.apache.maven.artifact.resolver.ArtifactResolutionException:
Unable to get dependency information for org.apache.maven.surefire:surefire-grouper:jar:2.12.4: Failed to retrieve POM for org.apache.maven.surefire:surefire-grouper:jar:2.12.4:
Could not transfer artifact org.apache.maven.surefire:surefire-grouper:pom:2.12.4 from/to maven (https://repo1.maven.org/maven2): sun.security.validator.ValidatorException:
PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: u
nable to find valid certification path to requested target [ERROR] org.apache.maven.surefire:surefire-grouper:jar:2.12.4
[ERROR]
[ERROR] from the specified remote repositories:
[ERROR] maven (https://repo1.maven.org/maven2, releases=true, snapshots=true),
[ERROR] central (https://repo.maven.apache.org/maven2, releases=true, snapshots=false),
[ERROR] apache.snapshots (http://repository.apache.org/snapshots, releases=false, snapshots=true)
[ERROR] Path to dependency:
[ERROR] 1) dummy:dummy:jar:1.0
[ERROR] 2) org.apache.maven.surefire:surefire-junit47:jar:2.12.4
[ERROR] 3) org.apache.maven.surefire:common-junit48:jar:2.12.4
因此,我决定一个接一个地下载,但这是地狱,我宁愿解决这个问题,而不是手动下载所有东西。
发布于 2020-02-20 15:33:28
原来问题出在我们的防火墙上--它以某种方式阻止了对所有maven repos的请求。当我请求ITs停止并测试它时,maven能够从标准的maven repo (带有https的那个)下载所有内容。
https://stackoverflow.com/questions/60300627
复制相似问题