背景

众所周知maven中央仓库位于国外服务器,国内朋友在下载时比较缓慢,常常在构建一个新项目时要等待比较长的时间。如果能够直接从国内服务器下载,那将大幅缩短项目构建时间,下面介绍一下切换源的方法。

阿里云代理仓库

maven.aliyun.com 代理了很多公共的maven仓库。使用maven.aliyun.com中的仓库地址作为下载源,速度更快更稳定。

代理的仓库列表

仓库名称 代理源地址 使用地址
central https://repo1.maven.org/maven2/ https://maven.aliyun.com/repository/centralhttps://maven.aliyun.com/nexus/content/repositories/central
jcenter http://jcenter.bintray.com/ https://maven.aliyun.com/repository/jcenterhttps://maven.aliyun.com/nexus/content/repositories/jcenter
public central仓和jcenter仓的聚合仓 https://maven.aliyun.com/repository/publichttps://maven.aliyun.com/nexus/content/groups/public
google https://maven.google.com/ https://maven.aliyun.com/repository/googlehttps://maven.aliyun.com/nexus/content/repositories/google
gradle-plugin https://plugins.gradle.org/m2/ https://maven.aliyun.com/repository/gradle-pluginhttps://maven.aliyun.com/nexus/content/repositories/gradle-plugin
spring http://repo.spring.io/libs-milestone/ https://maven.aliyun.com/repository/springhttps://maven.aliyun.com/nexus/content/repositories/spring
spring-plugin http://repo.spring.io/plugins-release/ https://maven.aliyun.com/repository/spring-pluginhttps://maven.aliyun.com/nexus/content/repositories/spring-plugin
grails-core https://repo.grails.org/grails/core https://maven.aliyun.com/repository/grails-corehttps://maven.aliyun.com/nexus/content/repositories/grails-core
apache snapshots https://repository.apache.org/snapshots/ https://maven.aliyun.com/repository/apache-snapshotshttps://maven.aliyun.com/nexus/content/repositories/apache-snapshots
阅读全文 »

在Android开发时需要新下载或升级相应的工具包,通常大家都会使用sdk管理工具下载,但是由于默认采用的是google下载源,在实际下载过程中并不会太顺利,主要表现一是下载速度慢,二是如果不采用些技术手段,连google网站都上不去。

此时我们可以换个下载源来解决这个问题,比如选择国内的某个源来提高下载速度。

阅读全文 »