本文来自于【阿里云官方镜像站:developer.aliyun.com/mirror/?utm… 】
原文链接:developer.aliyun.com/article/754…
镜像下载、域名解析、时间同步请点击 阿里巴巴开源镜像站
maven.aliyun.com代理了很多公共的maven仓库。使用maven.aliyun.com中的仓库地址作为下载源,速度更快更稳定。\
一、代理的仓库列表
仓库名称
代理源地址
使用地址
central repo1.maven.org/maven2/ maven.aliyun.com/repository/… 或 maven.aliyun.com/nexus/conte…
jcenter jcenter.bintray.com/ maven.aliyun.com/repository/… 或 maven.aliyun.com/nexus/conte…
public central仓和jcenter仓的聚合仓 maven.aliyun.com/repository/… 或maven.aliyun.com/nexus/conte…
google maven.google.com/ maven.aliyun.com/repository/… 或 maven.aliyun.com/nexus/conte…
gradle-plugin plugins.gradle.org/m2/ maven.aliyun.com/repository/… 或 maven.aliyun.com/nexus/conte…
spring repo.spring.io/libs-milest… maven.aliyun.com/repository/… 或 maven.aliyun.com/nexus/conte…
spring-plugin repo.spring.io/plugins-rel… maven.aliyun.com/repository/… 或 maven.aliyun.com/nexus/conte…
grails-core repo.grails.org/grails/core maven.aliyun.com/repository/… 或 maven.aliyun.com/nexus/conte…
apache snapshots repository.apache.org/snapshots/ maven.aliyun.com/repository/… 或 maven.aliyun.com/nexus/conte…
二、配置指南
- maven配置指南
打开maven的配置文件(windows机器一般在maven安装目录的conf/settings.xml),在标签中添加mirror子节点:
aliyunmaven
*
阿里云公共仓库
maven.aliyun.com/repository/…\
如果想使用其它代理仓库,可在节点中加入对应的仓库使用地址。以使用spring代理仓为例:
spring
maven.aliyun.com/repository/…
true
true
\
- gradle配置指南
在build.gradle文件中加入以下代码:
allprojects { repositories { maven { url 'maven.aliyun.com/repository/…' } mavenLocal()
mavenCentral()
}
}\
如果想使用maven.aliyun.com提供的其它代理仓,以使用spring仓为例,代码如下:
allProjects { repositories { maven { url 'maven.aliyun.com/repository/…' }
maven { url 'maven.aliyun.com/repository/…
mavenLocal()
mavenCentral()
}
}