赞
踩
allprojects{
repositories {
maven { url 'https://maven.aliyun.com/repository/public/' }
maven { url 'https://maven.aliyun.com/repository/jcenter/' }
maven { url 'https://maven.aliyun.com/repository/central/' }
maven { url 'https://maven.aliyun.com/repository/google/' }
maven { url 'https://maven.aliyun.com/repository/gradle-plugin/' }
}
}
Maven 公共制品库在海外,虽然配置了使用阿里云镜像,但拉取 jar 包还是查了海外资源,因此修改一下配置:
def repoConfig = { all { ArtifactRepository repo -> if (repo instanceof MavenArtifactRepository) { def url = repo.url.toString() if (url.contains('repo1.maven.org/maven2') || url.contains('repo.maven.org/maven2') || url.contains('repo.maven.apache.org/maven2') || url.contains('jcenter.bintray.com') || url.contains('maven.google.com') || url.contains('plugins.gradle.org/m2') || url.contains('repo.spring.io/libs-milestone') || url.contains('repo.spring.io/plugins-release') || url.contains('repo.grails.org/grails/core') || url.contains('repository.apache.org/snapshots') ) { println "gradle init: [buildscript.repositories] (${repo.name}: ${repo.url}) removed" remove repo } } } // Maven 镜像聚合了:central、jcenter、google、gradle-plugin maven { url 'https://maven.aliyun.com/repository/central' } maven { url 'https://maven.aliyun.com/repository/jcenter' } 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/' } } allprojects { buildscript { repositories repoConfig } repositories repoConfig }
repositories {
maven {
url 'https://maven.aliyun.com/repository/gradle-plugin'
}
}
distributionUrl=https\://mirrors.cloud.tencent.com/gradle/gradle-7.3-bin.zip
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。