jcenter访问失败(翻墙) - Sat, Sep 21, 2019
jcenter访问失败(翻墙)
1. 概述
jcenter
是一个由bintray.com
维护的Maven仓库,国内访问有时候会出错。
example代码位置: example
2. 使用aliyun代理
buildscript {
ext.kotlin_version = '1.3.50'
repositories {
// 阿里云 maven 地址
maven{ url 'http://maven.aliyun.com/nexus/content/groups/public' }
maven{ url 'http://maven.aliyun.com/nexus/content/repositories/jcenter' }
google()
// jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
allprojects {
repositories {
// 阿里云 maven 地址
maven{ url 'http://maven.aliyun.com/nexus/content/groups/public' }
maven{ url 'http://maven.aliyun.com/nexus/content/repositories/jcenter' }
google()
// jcenter()
}
}
rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')
}
task clean(type: Delete) {
delete rootProject.buildDir
}