環境配置:
說明:spring源碼從svn遷移到Github,基於Gradle來構建項目
Git地址:https://github.com/spring-projects/spring-framework
1、下載代碼到本機
git clone https://github.com/spring-projects/spring-framework.git
2、下載源碼後有個文件import-into-idea.md,裏面有相應的步驟
Step1、
進入spring-framework工程
執行./gradlew :spring-oxm:compileTestJava 如下圖:
Step2、
./gradlew
Step3、項目導入idea 時間比較長
Import into IntelliJ (File -> New -> Project from Existing Sources -> Navigate to directory -> Select build.gradle
Step4、刪除spring-aspects模塊 原因:spring-aspects
does not compile due to references to aspect types unknown to IntelliJ IDEA. See http://youtrack.jetbrains.com/issue/IDEA-64446 for details. In the meantime, the ‘spring-aspects’ can be excluded from the project to avoid compilation errors.
File->Project Structure->Modules delete spring-aspects
Step5、
Rebuild Project 編譯成功