Download the source code
2B brother telecommuting at home, whim, finishing spring source code to play. You can download it on Github, or you can download the source of my class (annotated)
Git clone github.com/spring-proj…
- Configure the Gradle compilation environment
Spring source code is compiled using Gradle, so the Gradle compilation environment needs to be configured first
- Gradle download install download address, my local environment using V4.10.2
- Decompress the installation, and the installation path does not appear blank (recommended), as shown in the figure
2. Configure environment variables
Select the system variable path, edit, open up the editing environment, create a new,
Enter the configuration path C:\apache\ Gradle-4.10.2\ bin
- Verify that the environment installation is normal. The following figure indicates that the environment is normal
3. Import IDEA and configure the IDEA environment
-
Import Spring-framwork into idea
Open IDEA, select File– Open, select the decompressed Spring-Framwork, and import it into IDEA
- Configure the Gradle environment in IDEA
File– Settings, search for Gradle, and configure Gradle
Specify gradle Home: C:/apache/gradle-4.10.2 installation path
Service directory path Specifies the gradle repository: D:/maven/gradle/
The VM parameters are optional: -xx :MaxPermSize=2048m -XMx2048m -xx :MaxHeapSize=2048m
Wait a long time for gradle to load environment
4. Compile source code
Open the Terminal middle Terminal, enter the following command to compile spring source code, and wait for the result
gradlew spring-oxm:compileTestJava
If BUILD SUCCESSFUL is displayed, the compilation succeeds
Create a New Module and select the Gradle project
After creation, open build.gradle and import the dependent JAR in the following format
Write test classes, tests
welfare
Pay attention to 2B elder brother’s public number (Java2B), send spring source code is just an atlas.