Get the Spring source code from GitHub

This article describes how to get the spring source code from GitHub and use the Gradle build to build the project.

 

1. Install GitHub

Go to the GitHub official website to download GitHub. The corresponding download address for the windows system is: http://windows.github.com/ After downloading, double-click to install.

 

2. Install Gradle

Download Gradle from http://www.gradle.org/downloads . After downloading, extract the file to the specified directory, for example: D:\gradle-2.7, and then configure the environment variables.  
1) Create the GRADLE_HOME system variable according to the corresponding directory. My value here is D:\gradle-2.7.  
2) Add %GRADLE_HOME%\bin; to the path.  
3) Test whether gradle is installed successfully: Open the cmd window and enter gradle -version, and the version information will be displayed if successful.

 

3. Download spring

First open GitHub, click the Git Shell option in the shortcut menu, and use the cd command to change the current directory to the directory where the source code is saved, assuming E:\SpringCode. Execute the following commands in this directory: 
git clone git://github.com/SpringSource/Spring-framework.git

After waiting for a while, the download is complete:

write picture description here

Go to E:\SpringCode to check and find that the corresponding source code is already available.

 

4. Convert to eclipse project

The source code downloaded now cannot be imported directly into Eclipse. The following uses Gradle to build the Spring transaction part of the source code.  
Open the cmd window, switch the directory to the source code of the Spring transaction part, and execute gradle cleanIdea eclipse

write picture description here

 

Enter and wait for a while, the following figure shows that the conversion of Spring source code into eclipse project is successful:

write picture description here

At this point, look at the spring-tx folder and find that it has become a mode that can be imported into the eclipse project

 

5. Import eclipse

Import into eclipse and find that the project name has a red exclamation mark

write picture description here

 

This is because the project also depends on other Spring projects. Perform step 4 in turn and import it into eclipse.

write picture description here

 

Transfer: http://blog.csdn.net/u013131533/article/details/48626657

 

Note:

1. After importing the spring source code, spring-cglib-repack-3.2.4.jar and spring-objenesis-repack-2.4.jar will be missing in the project, which can be downloaded at the following address.

http://download.csdn.net/download/woshizhhblog/9693878

 

2. After the above operation is completed, there is a GroovyDynamicElementReader error because the eclipse plug-in of groovy is not installed.

You can add a groovy download link in eclipse's Help -> Install New Software

http://dist.springsource.org/milestone/GRECLIPSE/e4.4/
Then after selecting all, start the download, after downloading, restart eclipse, then clean the project and you're done.

Reference: http://blog.csdn.net/paincupid/article/details/43902437

Plug-in official website: https://github.com/groovy/groovy-eclipse/wiki

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326455990&siteId=291194637