gradle配置国内镜像
来源:互联网 发布:什么软件可以打电话 编辑:程序博客网 时间:2024/06/05 21:06
使用阿里云国内镜像
对单个项目生效,在项目中的build.gradle修改内容
buildscript { repositories { maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' } maven{ url 'http://maven.aliyun.com/nexus/content/repositories/jcenter'} } dependencies { classpath 'com.android.tools.build:gradle:2.2.3' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } }allprojects { repositories { maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' } maven{ url 'http://maven.aliyun.com/nexus/content/repositories/jcenter'} }}
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
对所有项目生效,在USER_HOME/.gradle/下创建init.gradle文件
allprojects{ repositories { def ALIYUN_REPOSITORY_URL = 'http://maven.aliyun.com/nexus/content/groups/public' def ALIYUN_JCENTER_URL = 'http://maven.aliyun.com/nexus/content/repositories/jcenter' all { ArtifactRepository repo -> if(repo instanceof MavenArtifactRepository){ def url = repo.url.toString() if (url.startsWith('https://repo1.maven.org/maven2')) { project.logger.lifecycle "Repository ${repo.url}</span> replaced by <span class="hljs-variable">$ALIYUN_REPOSITORY_URL." remove repo } if (url.startsWith('https://jcenter.bintray.com/')) { project.logger.lifecycle "Repository ${repo.url}</span> replaced by <span class="hljs-variable">$ALIYUN_JCENTER_URL." remove repo } } } maven { url ALIYUN_REPOSITORY_URL url ALIYUN_JCENTER_URL } }}
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
转自:http://blog.csdn.net/lj402159806/article/details/78422953
阅读全文
0 0
- gradle配置国内镜像
- gradle配置国内镜像
- maven国内镜像配置
- yum国内镜像配置
- maven配置国内镜像
- composer 国内镜像配置
- yum国内镜像配置
- docker配置国内镜像
- 配置Gradle国内镜像源
- maven国内镜像配置(Ubuntu)
- Android SDK 国内镜像配置
- php composer安装 &&配置国内镜像
- python-配置国内下载镜像
- Docker中配置国内镜像
- maven国内镜像配置(Ubuntu)
- 国内npm镜像及配置方法
- 国内Ubuntu镜像
- CentOS国内镜像
- jconsole监控远程linux tomcat运行情况的配置
- PIL、Pillow安装使用方法
- Java基础笔记
- 阿里云快速搭建一个静态网站
- java 静态内部类
- gradle配置国内镜像
- 蓝桥杯 基础练习 Sine之舞
- BZOJ2463 [中山市选2009]谁能赢呢?
- 开源软件,自由软件,免费软件三者的区别
- Linux学习笔记(二)Linux目录------参考用的
- public new ChatQueryOption[] GetQueryOptions()的new
- as笔记一:Android studio关联Git
- Xmanager连接linux桌面以及linux安装虚拟机
- 博客第一篇