300字范文,内容丰富有趣,生活中的好帮手!
300字范文 > aliyun gradle 代理_怎么使用阿里云的Gradle Google镜像?

aliyun gradle 代理_怎么使用阿里云的Gradle Google镜像?

时间:2024-04-30 00:21:50

相关推荐

aliyun gradle 代理_怎么使用阿里云的Gradle Google镜像?

在我的项目中需要用到google()来读取dependencies,见下文:

buildscript {

repositories {

maven{ url '/nexus/content/groups/public/' }

google()

jcenter()

}

dependencies {

classpath 'com.android.tools.build:gradle:3.0.1'

}

}

allprojects {

repositories {

maven{ url '/nexus/content/groups/public/' }

google()

jcenter()

}

}

rootProject.buildDir = '../build'

subprojects {

project.buildDir = "${rootProject.buildDir}/${project.name}"

}

subprojects {

project.evaluationDependsOn(':app')

}

task clean(type: Delete) {

delete rootProject.buildDir

}

其中google()和jcenter()是被墙的,而 /nexus... 并不包括的google() & jcenter(),如果不用它们就会出现:

> root project > :app > Resolve files of classpath

卡住的问题……

阿里提供的镜像包括了Google和Jcenter:

但是如果我这样用:

google(){ url '/repository/google' }

会报错:

Could not find method google() for arguments [build_481dup0nhfy99x57ko80vlobp$_run_closure1$_closure2$_closure5@7388ff6f] on repository container of type org.gradle.api.internal.artifacts.dsl.DefaultRepositoryHandler.

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。