配置maven无法下载(COULD NOT TRANSFER ARTIFACT ORG.APACHE.MAVEN.PLUGINS问题)

配置maven无法下载(COULD NOT TRANSFER ARTIFACT ORG.APACHE.MAVEN.PLUGINS问题)

提示:下面是maven3.6.3版本百度云链接,记住maven3.3以上版本必须安装jdk1.7及以上版本,否则会出错。
链接:https://pan.baidu.com/s/1J0FNIBlF0JIm3QB9sIIlaA
提取码:4gud


问题描述:

在学习maven项目时,下载jar包一直出错,看了很多博客都不行,最后才知道是最开始看的那篇博客的镜像有问题,原地爆炸。

Could not transfer artifact org.apache.maven.plugins:maven-clean-plugin:pom:2.5 from/to central (https://repo.maven.apache.org/maven2): Transfer failed for https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-clean-plugin/2.5/maven-clean-plugin-2.5.pom

解决方案:

1,查看settings配置中的镜像是否有问题

我们需要在settings中配置镜像,不然得享受蜗速,同时若是使用的过期镜像也会导致,我们不能下载maven包。具体操作如下:
配置阿里云镜像资源

    <mirror>
      <id>alimaven</id>
      <name>aliyun maven</name>
      <url>http://maven.aliyun.com/nexus/content/repositories/central/</url>
      <mirrorOf>central</mirrorOf>
    </mirror>

    <!-- junit镜像地址 -->
    <mirror>
      <id>junit</id>
      <name>junit Address/</name>
      <url>http://jcenter.bintray.com/</url>
      <mirrorOf>central</mirrorOf>
    </mirror>
  </mirrors>

2,查看settings配置是否有问题

IDEA->setting里去找Maven,如下Maven home路径和之下的User settings file路径是否一致。不一致的话我们需要将我们解压的maven文件下的settings文件路径拷贝到对应的输入框。
在这里插入图片描述

3,更改idea中的证书问题

证书错误,访问https协议的网站,需要ssl认证才行,这里没有证书,我们可以用下面的方式忽略ssl检查导致的问题。
我们可以到IEDA->setting里,去找 Maven,在importing里加入如下的语句:

-Dmaven.wagon.http.ssl.insecure=true -Dmaven.wagon.http.ssl.allowall=true

在这里插入图片描述
到这里基本就ok了如果证书问题还是解决不了,我们再向File - settings中的maven - Runner中添加这句话:

-Dmaven.wagon.http.ssl.insecure=true -Dmaven.wagon.http.ssl.allowall=true -Dmaven.wagon.http.ssl.ignore.validity.dates=true -DarchetypeCatalog=internal

在这里插入图片描述

结语:

如果还是不行,可以再试试降低maven的版本,也有可能是maven版本、JDK和IDEA的版本不兼容,多试试降低版本试试。
最后祝各位大佬好运,写代码没有bug!

  • 4
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 3
    评论
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值