maven仓库设置阿里云镜像加速(https://maven.aliyun.com/repository/public)

前言

maven在国内连接到中央仓库下载jar包太慢了,如果想加速的话,可以切换到阿里云maven镜像库

2023.12.17更新,更新https连接和更新新版阿里云链接

阿里云镜像仓库信息

具体可以移步阿里云Maven使用指南

仓库名称阿里云仓库地址阿里云仓库地址(老版)源地址
centralhttps://maven.aliyun.com/repository/centralhttps://maven.aliyun.com/nexus/content/repositories/centralhttps://repo1.maven.org/maven2/
publichttps://maven.aliyun.com/repository/publichttps://maven.aliyun.com/nexus/content/groups/publiccentral仓和jcenter仓的聚合仓
gradle-pluginhttps://maven.aliyun.com/repository/gradle-pluginhttps://maven.aliyun.com/nexus/content/repositories/gradle-pluginhttps://plugins.gradle.org/m2/
apache snapshotshttps://maven.aliyun.com/repository/apache-snapshotshttps://maven.aliyun.com/nexus/content/repositories/apache-snapshotshttps://repository.apache.org/snapshots/

方案一:在POM.xml里面定义阿里云maven

下载jar包的时候很快,但是缺点就是maven相关的包比较慢

<repositories>
		<repository>
			<id>alimaven</id>
			<name>aliyun maven</name>
			<url>https://maven.aliyun.com/repository/public</url>
		</repository>
</repositories>

就可以享用高速下载了

另外,需要什么类可以在以下地址进行搜索
http://maven.aliyun.com/mvn/search

在这里插入图片描述
在这里插入图片描述

方案二:设置settings.xml

这个mirror 镜像设置比较全局,一般修改C:\Users\Administrator\.m2\settings.xml ,之后所有的maven相关的包也会从阿里云加载

<mirror>    
      <id>central</id>    
      <name>central</name>                                                                                                                           
      <url>https://maven.aliyun.com/repository/public</url>   
      <mirrorOf>central</mirrorOf>    
</mirror>

在这里插入图片描述

在这里插入图片描述

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值