date[2019-08-12]
[TOC]
上传仓库地址
Spring源码环境准备
- clone Spring源码,并checkout指定版本(以v5.1.12.RELEASE为例)
//git checkout -b [分支名称] [tag标签名称] $git clone -b v5.1.12.RELEASE https://github.com/spring-projects/spring-framework.git
- 配置
gradle
,以win10为例- gradle加path环境变量
- 新增环境变量GRADLE_USER_HOME,设置成maven的repository
- 配置 (使用aliyun) C:\Users[用户名].gradle\init.gradle
allprojects{
repositories {
def ALIYUN_REPOSITORY_URL = 'http://maven.aliyun.com/nexus/content/groups/public'
maven {
url ALIYUN_REPOSITORY_URL
}
}
}
-
注释
settings.gradle
以下内容
artifacts {
// archives docsZip
// archives schemaZip
// archives distZip
} -
进入主目录,执行
gradlew.bat build
init.gralde配置参考
allprojects{
repositories {
def ALIYUN_REPOSITORY_URL = 'http://maven.aliyun.com/nexus/content/groups/public'
def ALIYUN_JCENTER_URL = 'http://maven.aliyun.com/nexus/content/repositories/jcenter'
def SPRINGSOURCE_URL = 'http://repo.springsource.org/plugins-release'
all { ArtifactRepository repo ->
if(repo instanceof MavenArtifactRepository){
def url = repo.url.toString()
if (url.startsWith('https://repo1.maven.org/maven2')) {
project.logger.lifecycle "Repository ${repo.url} replaced by $ALIYUN_REPOSITORY_URL."
remove repo
}
if (url.startsWith('https://jcenter.bintray.com/')) {
project.logger.lifecycle "Repository ${repo.url} replaced by $ALIYUN_JCENTER_URL."
remove repo
}
}
}
maven {
url ALIYUN_REPOSITORY_URL
url ALIYUN_JCENTER_URL
url SPRINGSOURCE_URL
}
}
}
网友评论