安装gradle
allprojects{
repositories {
def REPOSITORY_URL = 'http://maven.aliyun.com/nexus/content/groups/public/'
all { ArtifactRepository repo ->
def url = repo.url.toString()
if ((repo instanceof MavenArtifactRepository) && (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 }
}}
编译spring源码
allprojects {
repositories {
maven{ url 'http://maven.aliyun.com/nexus/content/groups/public/'}
}
}
image.png
- 编译spring源码,在spring源码项目根目录执行:./gradlew :spring-oxm:compileTestJava
- 修改setting.gradle文件,修改第一段代码的配置,增加阿里的镜像
pluginManagement {
repositories {
maven { url "https://maven.aliyun.com/repository/public" }
gradlePluginPortal()
maven { url 'https://repo.spring.io/plugins-release' }
}
}
网友评论