SpringBoot添加依赖包Could not transfer artifact XXX from/to central错误的问题

写在前面

出现该问题是因为没有配置Maven仓库,引用阿里云的代理仓库就可解决该问题。文章可能还有很多不足,请大家谅解,欢迎大佬提意见。

本文使用的东西

  1. IntelliJ 2019
  2. SpringBoot项目

1.解决方法

1.在pom.xml中加入以下内容:

    <repositories>
        <repository>
            <id>maven-ali</id>
            <url>http://maven.aliyun.com/nexus/content/repositories/central</url>
            <releases>
                <enabled>true</enabled>
            </releases>
            <snapshots>
                <enabled>true</enabled>
                <updatePolicy>always</updatePolicy>
                <checksumPolicy>fail</checksumPolicy>
            </snapshots>
        </repository>
    </repositories>

在这里插入图片描述

2.总结

关于该错误的解决到此结束,有不清楚的地方欢迎评论留言,看到的我都会回复的。本文到此结束,有什么不足的地方请大家不吝指正。

发布了38 篇原创文章 · 获赞 17 · 访问量 1254

猜你喜欢

转载自blog.csdn.net/nineya_com/article/details/103328985
今日推荐