• Why read the Spring source code
  • Environmental tools
  • Download the source code
  • The code to compile
  • The demo sample

01 Why read source code

Personally, I think there are two points. The first is to open the gap between people. The second is to pretend to be forced, as for other temporarily have not thought of, have a better point of view welcome everyone to leave a message in the comment section!

02 Environment Tools

The JDK: 1.8

Grdle: 6.5.1

The IDEA:

The JDK installation

JDK installation should not need to hand guide it, if really not Baidu search will have.

Grdle installation
  • Download it at gradle.org/releases/

  • Configuring Gradle environment variables is the same as configuring JDK environment variables;

GRADLE_HOME= download gradle location; Edit the path, % GRADLE_HOME % \ binCopy the code
  • Verify that gradle environment variables are configured successfully (enter gradle -v if the following is displayed)

03 Source Code Download

Spring source code

Spring source code

Spring’s download

Spring source code on Github, but the download speed is relatively slow, the country code cloud also has its source code, it is recommended to fork a code from the code cloud in their own warehouse, so that they can add annotations and modify when reading the source code;

  • Code cloud download address: gitee.com/mirrors/Spr…

  • My own Spring-Framework code cloud address: gitee.com/ChristianWy… (I’ll keep adding my own insights.)

Note: After downloading, cut the branch to 5.2.x

  • Configure your gradle download on IDEA:

Spring source code

Enter the following command on the console for IDEA:

gradlew :spring-oxm:compileTestJava

If sucesss appears on the console, it is compiled successfully.

04 demo example

The demo example

The demo example
  • Create a new module in your compiled Spring source code.

It is important to configure the spring source code compiled locally in the new module build.gradle.

Conclusion:

1: Demo download address: gitee.com/ChristianWy…

2: Leave a message at www.wozhendiao.com:8443/

3: Wechat official account: Wang Yi ‘an na

4: Author: Flying fish