环境配置:
说明: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 编译成功