Spring Source Code Analysis-import spring-framework source code to Eclipse

Source: Internet
Author: User

I recently want to study the source code of spring, but I encountered a lot of trouble when I want to import the spring sub project to Eclipse (in fact, I blame myself for taking it for granted ). Find the gitHub homepage (http://springsource.org/spring-framework) for spring-framework ), without reading the instructions in the README section, I directly copied the source code plug-out of the project and imported the spring-core sub project under the v3.2.4.RELEASE directory under tags into the project in Eclipse. After checking out, we found that the directory structure in it adopts the maven style, so we directly converted it into a maven project. After the conversion was successful, many errors were found, and the dependent jar package was not imported in, at the beginning, I wanted to directly import data through maven, but later I found that this process could not be implemented. Too many dependent jar files could not be used, and a sub-project would be fine, spring Source Code contains more than a dozen sub-projects. When I was busy for half a day, the rogue had to give up and continue looking for other solutions. The result is that the source code building document is displayed on the gitHub homepage of spring-framework. It is found that spring framework is automatically built using Gradle. After self-exploration, all the sub-items are finally imported at one time. The procedure is as follows: 1. select a version from svn (I select tags/v3.2.4.RELEASE here) and export it to a directory (for example, D:/opensource/spring-framework ). 2. Install the Gradle software. The installation process is very simple. For details, see the official document http://www.gradle.org/docs/current/userguide/userguide_single.html#installation. 3. enter D:/opensource/spring-framework directory contains a import-into-eclipse.bat batch processing file, as the name suggests, double-click the console interface appears, press twice in a row the return key, you can start building automatically, the build process takes a long time (downloading various dependent jar packages and dom files). Maybe the speed in my house is not good, and it took several hours. In the middle also often stop does not move, press Ctrl + c to terminate the operation, once again double-click the import-into-eclipse.bat file to repeat the above process (will continue to build the location of the last build ), the console will automatically shut down after the build is complete. 4. in Eclipse, choose "File ---> import" under "General" and select "Exsiting projects into workspace". This completes the import. Somehow, several source File errors may occur, for example, @ Override has a non-existent method (the processing method is to remove the @ Override annotation). Note that some sub projects require jre1.7 or above (the new api in 1.7 is referenced in it ).

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.