准备
- 装好git工具
- 装好gradle工具
- 装好idea(我这里是用idea阅读的源码)
源码下载
github地址:https://github.com/spring-projects/spring-framework
-
选择阅读的版本(我这里选的是3.2),复制克隆地址准备下载
-
在本地准备存放源码的文件夹右键–> git bash here 后输入
git clone -b 3.2.x https://github.com/spring-projects/spring-framework.git后就自己开始了下载源代码,如图:
小技巧:git bash 的复制粘贴的快捷键与linux一样 ctrl+insert 、shift+insert
idea导入项目
根据不同版本,请查看源码中的import-into-idea.md文件(改文件是Markdown格式文件,可用 http://markdown.xiaoshujiang.com/ 在线打开查看,idea也行),我这以springframework 3.2.x为例。
- 源码所在目录输入cmd 打开cmd窗口
- 根据
import-into-idea.md文件中的提示,输入命令./gradlew :spring-oxm:compileTestJava cleanIdea idea,我这边输入的是gradlew :spring-oxm:compileTestJava cleanIdea idea, ./ 报错,结果如图:
中间报错,截图:
* Where:
Script 'D:\workspace\study\github\source-springframework\spring-oxm\oxm.gradle' line: 123
* What went wrong:
Execution failed for task ':spring-oxm:compileTestJava'.
> JiBXException in JiBX binding compilation
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
解决办法参考博客:https://blog.csdn.net/zx1323/article/details/79706620
下载完jar包之后,最终编译成功
- idea正常open打开项目即可
后续更新