首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >Maven无法从https://repo.maven.apache.org/maven2下载依赖项/插件

Maven无法从https://repo.maven.apache.org/maven2下载依赖项/插件
EN

Stack Overflow用户
提问于 2020-02-19 20:41:04
回答 1查看 339关注 0票数 0

当我试图构建我的项目时,我得到了以下错误:

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插件,这次的问题是类似的:

代码语言:javascript
运行
复制
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

因此,我决定一个接一个地下载,但这是地狱,我宁愿解决这个问题,而不是手动下载所有东西。

EN

Stack Overflow用户

发布于 2020-02-20 15:33:28

原来问题出在我们的防火墙上--它以某种方式阻止了对所有maven repos的请求。当我请求ITs停止并测试它时,maven能够从标准的maven repo (带有https的那个)下载所有内容。

票数 1
EN
查看全部 1 条回答
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/60300627

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档