1.gradle 配置环境变量
1.1添加gradle目录变量
1.2添加gradle到path中
2.配置gradle国内镜像
2.1 在gradle目录的init.d文件夹下创建init.gradle文件
2.2 添加配置到init.gradle中
allprojects{
repositories {
def REPOSITORY_URL = 'http://maven.aliyun.com/nexus/content/groups/public/'
all { ArtifactRepository repo ->
if(repo instanceof MavenArtifactRepository){
def url = repo.url.toString()
if (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
}
}
}
3.IntelliJ IDEA 配置 gradle
配置完毕!