Use IDEA to build a Spring source code reading environment

Spring source code reading environment construction

Spring has migrated the source code from SVN to GitHub, and has also changed to Gradle to build the project. It replaces the previous Ant+lvy system, so Git and Gradle must be installed before building the Spring source code. The installation of these two tools will not be repeated.

Download Spring

Because Spring is managed by GitHub, we have to use the Git clone command to pull it to our local area, but because GitHub points to the external network, our domestic download is particularly slow, and Spring is a very large project, so we can use Another way, you can do a transit through the domestic Git website code cloud to obtain

  1. Get Spring's Git address on GitHub now

    https://github.com/spring-projects/spring-framework.git

  2. Open Code Cloud to get the GitHub code, as shown below, choose to import the warehouse from GitHub/GitLab

After importing, there will be a local warehouse of Code Cloud, and then we can download it through the address of Code Cloud

  1. Open GitBash, download the code through the warehouse address of Code Cloud, so that the speed is very fast.

  2. At this time, we check the information that the Spring source code already exists in the corresponding folder

Import Spring into IDEA

  • File -> New -> Project from Existing Sources -> find and select spring-framework source code

  • Configure Gradle as its own local

  • Modify the Gradle configuration in the Spring source code and add the following code in build.gradle

    maven { url "http://maven.aliyun.com/nexus/content/groups/public" }

    image-20200526174917891

  • After saving it, it is recommended to restart the idea to compile, and the compilation is passed!

Guess you like

Origin blog.csdn.net/pengyiccb/article/details/106361866