本地构建Spring源码步骤

1. 通过gitee(码云去拉取代码)

本地构建Spring源码步骤_第1张图片

将Spring-framework源码git路径贴进去:https://github.com/spring-projects/spring-framework.git

然后本地拉取码云(gitee)上面的代码

需要登录账号,登录账号的时候不可以登录第三方的账号,只能在码云上面申请账号然后登录
git clone https://gitee.com/liaojuhui/spring-framework.git

创建属于自己的分支

cd /spring-framework

git checkout -b  [自己的本地分支名] v5.2.4.RELEASE

Mac配置Gradle

进入 cd ~/.gradle 目录,新建一个文件,文件名和后缀为:init.gradle
allprojects{
  repositories {
    def REPOSITORY_URL = 'http://maven.aliyun.com/nexus/content/groups/public/'
    all { ArtifactRepository repo ->
      if(repo instanceof MavenArtifactRepository){
        def url = repo.url.toString()
        if (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
    }
  }
}

Window配置

在home ./gradle 目录下新建 init.gradle内容同上

 

--------------------------------------------下面是构建命令----------------------------------------

Mac构建命令

./gradlew build -x javadoc -x dokka -x asciidoctor -x test

Window构建命令

gradlew.bat build -x javadoc -x dokka -x asciidoctor -x test

拖马老师的福

你可能感兴趣的:(Spting)