基于SpringBoot 2.3.9.RELEASE 版本
前期准备
如果希望搭建SpringBoot源码阅读环境,必须科学上网,不要相信使用国内源下载依赖,阿里的源会有问题
流程
克隆代码,切换到
2.3.9.release分支,导入IDE这里如果下载依赖正常,通常还是会报错的,需要注释掉源码中的两处
settings.gradle中注释掉’io.spring.ge.conventions’1
2
3
4plugins {
id "com.gradle.enterprise" version "3.5.2"
// id "io.spring.ge.conventions" version "0.0.7"
}buildSrc下build.gradle中注释掉io.spring.javaformat1
2
3
4
5plugins {
id "java-gradle-plugin"
//id "io.spring.javaformat" version "${javaFormatVersion}"
id "checkstyle"
}
补充说明
一般下载完依赖,注释掉格式化等插件就可以直接在IDE中运行spring-boot-tests下的测试用例了
但我选择在源码根目录下新建spring-boot-test模块然后新建一个正常的SpringBoot程序,只不过引用的是源码中的依赖
我使用的版本是v2.3.9.release版,使用gradle做依赖管理,下面是build.gradle示例
1 | plugins { |