Gradle的仓库一般用于下载软件和插件。在项目的build.gradle中配置。
Gradle默认使用google、jcenter仓库。
buildscript {
repositories {
google()
jcenter()
}
}
allprojects {
repositories {
google()
jcenter()
}
}
在国内使用jcenter、mavenCentral及google三个远程仓库,Gradle Sync会很慢,google仓库甚至需要不能访问。一般使用阿里云仓库。
buildscript {
repositories {
maven{ url 'https://maven.aliyun.com/repository/public'}
maven { url 'https://maven.aliyun.com/repositories/jcenter' }
maven { url 'https://maven.aliyun.com/repositories/google' }
maven { url 'https://maven.aliyun.com/repository/central' }
}
}
allprojects {
repositories {
maven{ url 'https://maven.aliyun.com/repository/public'}
maven { url 'https://maven.aliyun.com/repositories/jcenter' }
ma