赞
踩
改成阿里云
在build.gradle
buildscript { repositories { // 添加阿里云 maven 地址 maven{url 'http://maven.aliyun.com/nexus/content/groups/public/'} maven{ url 'https://maven.aliyun.com/repository/google'} maven{ url 'https://maven.aliyun.com/repository/gradle-plugin'} maven{ url 'https://maven.aliyun.com/repository/public'} maven{ url 'https://maven.aliyun.com/repository/jcenter'} google() jcenter()
}
}
allprojects { repositories { maven{url 'http://maven.aliyun.com/nexus/content/groups/public/'} maven{ url 'https://maven.aliyun.com/repository/google'} maven{ url 'https://maven.aliyun.com/repository/gradle-plugin'} maven{ url 'https://maven.aliyun.com/repository/public'} maven{ url 'https://maven.aliyun.com/repository/jcenter'} google() jcenter() } }
C:\Users\Administrator\.gradle
创建
init.gradle
allprojects{
repositories {
def REPOSITORY_URL = 'http://maven.aliyun.com/nexus/content/groups/public/'
all { ArtifactRepository repo ->
def url = repo.url.toString()
if ((repo instanceof MavenArtifactRepository) && (url.startsWith('https://repo1.maven.org/maven2') || url.startsWith('https://jcenter.bintray.com'))) {
project.logger.lifecycle 'Repository ${repo.url} replaced by $REPOSITORY_URL .'
remove repo
}
}
maven {
url REPOSITORY_URL
}
}
}
困扰了1天,终于找到方法,亲测OK
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。