1、环境准备
首先需要确保已经安装和配置jdk8,maven,git环境
2、项目下载
从github获取源码。网址:https://github.com/spring-projects/spring-boot
我们使用的是2.1.3.RELEASE版本,点击release 之后在tags查找相应版本或者访问https://github.com/spring-projects/spring-boot/releases/tag/v2.1.3.RELEASE
找到 后点击sourcecode下载源码压缩包
3、搭建源码阅读环境
导入到idea
查看spring-boot-project下的pom,会看到使用的环境的版本,因为源码有环境约束插件,为了避免遇到错误,选择对应的环境
选择fast,还有编辑去掉test
之后在父pom中添加<disable.checks>true</disable.checks>
右侧在root下点击install
开始编译,等待完成,时间可能比较久
编译完成后,在spring-boot-samples-invoker下的pom中添加<skipTests>true</skipTests>
在父pom中添加<module>spring-boot-samples</module>,重新编译,至此,环境搭建完成
运行spring-boot-samples下的demo,看是否ok