Failed to read artifact descriptor for org.apache.XXX

[ERROR] Plugin org.apache.maven.plugins:maven-surefire-plugin:2.18.1 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-surefire-plugin:jar:2.18.1: Could not transfer artifact org.apache

遇到这个问题一般是:

1.无法下载该插件或者是无法下载依赖的jar包

2.之前下载的jar包是不完整的.(从本地maven仓库中删除该依赖的文件重新下载即可)

这时候需要留心插件下载地址是否正确,我配置是从私有仓库下载,但是有些是没有的,需要从阿里的maven镜像,或者是Maven中心仓库才能下载到依赖.

找到本地maven的settings.xml,配置mirrors如下:

     <mirror>
            <id>alimaven</id>
            <mirrorOf>central</mirrorOf>
            <name>aliyun maven</name>
            <url>http://maven.aliyun.com/nexus/content/repositories/central/</url>
     </mirror>
      <!-- 中央仓库1 -->
        <mirror>
            <id>repo1</id>
            <mirrorOf>central</mirrorOf>
            <name>Human Readable Name for this Mirror.</name>
            <url>http://repo1.maven.org/maven2/</url>
        </mirror>
     
        <!-- 中央仓库2 -->
        <mirror>
            <id>repo2</id>
            <mirrorOf>central</mirrorOf>
            <name>Human Readable Name for this Mirror.</name>
            <url>http://repo2.maven.org/maven2/</url>
        </mirror>
     <mirror>
           <id>ibiblio.org</id>
           <name>ibiblio Mirror of http://repo1.maven.org/maven2/</name>
           <url>http://mirrors.ibiblio.org/pub/mirrors/maven2</url>
           <mirrorOf>central</mirrorOf>
           <!-- United States, North Carolina -->
     </mirror>
     <mirror> 
         <id>jboss-public-repository-group</id> 
         <mirrorOf>central</mirrorOf> 
         <name>JBoss Public Repository Group</name> 
         <url>http://repository.jboss.org/nexus/content/groups/public</url> 
     </mirror>  
    <mirror>
        <id>osc</id>
        <mirrorOf>*</mirrorOf>
        <url>http://maven.oschina.net/content/groups/public/</url>
    </mirror>

重新build一下工程,或者是maven reimport

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

mtj66

看心情

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值