IDEA里Maven依赖无法下载的解决办法

IDEA里Maven依赖无法下载的解决办法

改为使用国内比较好用的仓库镜像配置,如阿里云,从而加快包的下载,不再从官方仓库缓慢下载而导致下载不下来。
1、项目中pom.xml中的远程仓库配置示例:
 //阿里云搭建了一个国内镜像http://maven.aliyun.com,跑起来速度很快,可以进行配置
    <repositories>
        <repository>
            <id>nexus-aliyun</id>
            <name>nexus-aliyun</name>
            <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
            <releases>
                <enabled>true</enabled>
            </releases>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </repository>
    </repositories>
2、本地maven子目录/conf/settings.xml中settings.xml中配置:
	
<mirror>
    <!--This sends everything else to /public -->
    <id>nexus-aliyun</id>
    <mirrorOf>*</mirrorOf>
    <name>Nexus aliyun</name>
    <url>http://maven.aliyun.com/nexus/content/groups/public</url>
</mirror>

或者直接从idea中打开设置setting.xml配置文件:
在这里插入图片描述
在这里插入图片描述
修改完毕之后,包的下载速度会变快,如果看到进度条还是艰难地从http://repo.maven.apache.org/maven2/ 官方仓库中 download 的话,尝试重启下 IDE 。

[借鉴这位老兄的经验,我只是记录一下](https://blog.csdn.net/weixin_36795183/article/details/79408167)

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值