赞
踩
原maven经常下载慢,让人痛苦不堪,使用阿里云镜像体验飞一般的下载速度。找到项目根build.gradle,添加以下代码即可
- maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }
- maven { url 'http://maven.aliyun.com/nexus/content/repositories/jcenter' }
- maven { url 'http://maven.aliyun.com/nexus/content/repositories/google' }
- maven { url 'http://maven.aliyun.com/nexus/content/repositories/gradle-plugin' }
完整例子
- buildscript {
- repositories {
- maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }
- maven { url 'http://maven.aliyun.com/nexus/content/repositories/jcenter' }
- maven { url 'http://maven.aliyun.com/nexus/content/repositories/google' }
- maven { url 'http://maven.aliyun.com/nexus/content/repositories/gradle-plugin' }
-
-
- jcenter()
- google()
- }
- dependencies {
- .......
- }
- }
-
- allprojects {
- repositories {
- maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }
- maven { url 'http://maven.aliyun.com/nexus/content/repositories/jcenter' }
- maven { url 'http://maven.aliyun.com/nexus/content/repositories/google' }
- maven { url 'http://maven.aliyun.com/nexus/content/repositories/gradle-plugin' }
-
- jcenter()
- google()
- }
- }
-
- task clean(type: Delete) {
- delete rootProject.buildDir
- }
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。