工具版本

  • Idea 2021.1.3
  • JDK11.0.12
  • Gradle6.8.3 

配置jdk、gradle环境变量

下载spring-framework源码

1.解压源码

2.spring源码下载依赖时,默认使用的是spring的仓库,由于网络限制,建议在build.gradle中配置国内的阿里提供的镜像仓库下载

repositories {

mavenCentral()

maven { url "https://repo.spring.io/libs-spring-framework-build" }

maven { url "https://repo.spring.io/snapshot" } // Reactor

maven {url 'https://maven.aliyun.com/nexus/content/groups/public/'} //阿里云

maven {url 'https://maven.aliyun.com/nexus/content/repositories/jcenter'}

}

3、修改spring-framework\spring-oxm\spring-oxm.gradle文件增加

compile("javax.xml.bind:jaxb-api:2.3.1")
compile("com.sun.xml.bind:jaxb-core:2.3.0.1")
compile("com.sun.xml.bind:jaxb-impl:2.3.0.1")
compile("com.sun.xml.bind:jaxb-xjc:2.3.0.1")

Spring最新源码(5.3.9)编译_maven

 

 

4.cmd命令切换到spring-framework目录

  • gradlew :spring-oxm:compileTestJava

Spring最新源码(5.3.9)编译_maven_02

 

  • gradlew :spring-core:compileTestJava

Spring最新源码(5.3.9)编译_spring_03

 

  •  gradlew.bat

Spring最新源码(5.3.9)编译_java_04

 

 5.源码导入idea

  • File->Settings

Spring最新源码(5.3.9)编译_spring_05