IDEA中Maven项目 导入依赖失败

joenheart 2020-02-05 11:37:12
问题:
当在pom中随便添加某依赖,比如:

<dependency>
<groupId>org.mongodb</groupId>
<artifactId>mongo-java-driver</artifactId>
<version>3.0.4</version>
</dependency>

会拉取失败,并给出下载的地址。点击下载的地址会跳转到浏览器,自动下载该jar包。这是什么原因?(Windows10环境下)
报错信息如下:
Could not transfer artifact org.mongodb:mongo-java-driver:pom:3.0.4 from/to alimaven (http://maven.aliyun.com/nexus/content/repositories/central/): Transfer failed for http://maven.aliyun.com/nexus/content/repositories/central/org/mongodb/mongo-java-driver/3.0.4/mongo-java-driver-3.0.4.pom

红色的就是给出的下载链接
settings.xml已经是阿里的,如下:
<mirror>
<id>nexus-aliyun</id>
<mirrorOf>*</mirrorOf>
<name>Nexus aliyun</name>
<url>http://maven.aliyun.com/nexus/content/groups/public</url>
</mirror>
<mirror>
<id>alimaven</id>
<mirrorOf>central</mirrorOf>
<name>aliyun maven</name>
<url>http://maven.aliyun.com/nexus/content/repositories/central/</url>
</mirror>
哪位大神知道啥原因吗?
...全文
1450 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
wmxz520 2020-08-05
  • 打赏
  • 举报
回复
不如试试我这个 <mirror> <id>alimaven</id> <name>aliyun maven</name> <url>http://maven.aliyun.com/nexus/content/groups/public/</url> <mirrorOf>*</mirrorOf> </mirror>
勇敢牛牛_ 2020-02-06
  • 打赏
  • 举报
回复

    <mirror>
      <id>alimaven</id>
      <name>aliyun maven</name>
      <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
      <mirrorOf>central</mirrorOf>        
    </mirror>
joenheart 2020-02-06
  • 打赏
  • 举报
回复
本地仓库中的lastU那文件我也每次都去清了,但还是不行
joenheart 2020-02-06
  • 打赏
  • 举报
回复
试了你这个,不起作用。在IDEA中的错误报错还是和之前的一样,在eclipse里的是 Project build error: Non-resolvable parent POM for knowledgeGraph:knowledgeGraph:0.0.1-SNAPSHOT: Failure to transfer org.springframework.boot:spring-boot-starter-parent:pom:2.1.12.RELEASE from http://maven.aliyun.com/nexus/content/repositories/central/ 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.springframework.boot:spring-boot-starter-parent:pom:2.1.12.RELEASE from/to alimaven (http://maven.aliyun.com/nexus/content/repositories/central/): sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target and 'parent.relativePath' points at wrong local POM 我之前查了下觉得是证书的问题,去阿里仓库下载了证书导入到jrd的keytool中去了,但还是不起作用。现在只能通过他下载失败给的连接,然后手动下载jar移到本地仓库文件夹里

81,091

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧