SpringBoot源码搭建


源码下载

需要环境 :

  • JDK 1.8+
  • Maven 3.5+
  • Spring Boot 1.x.x: Gradle 版本建议为2.9或更高版本。
  • Spring Boot 2.x.x: Gradle 版本建议为4.x.x或更高版本。

GitHub

从v2.3.x开始,SpringBoot开始强制用Gradle构建项目,如需使用maven搭建,可下载v2.2.13.RELEASE版本

在这里插入图片描述
这里下载并搭建windows版本

搭建

下载完成后解压,在解压目录下执行Maven项目构建命令:

mvn clean install -DskipTests -Pfast

在这里插入图片描述

会下载相关依赖的下载,稍等一会儿。

如果发生错误 :

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  01:41 min
[INFO] Finished at: 2023-12-11T15:04:42+08:00
[INFO] ------------------------------------------------------------------------
[INFO] 245 goals, 215 executed, 30 from cache, saving at least 2m:37s
[INFO]
[INFO] A build scan was not published as you have not authenticated with server 'ge.spring.io'.
[ERROR] Failed to execute goal com.googlecode.maven-download-plugin:download-maven-plugin:1.4.2:wget (unpack-doc-resources) on project spring-boot-gradle-plugin: IO Error: Error while expanding D:\StudyData\Spring\SpringBoot\SourceCode\spring-boot-2.2.13.RELEASE\spring-boot-project\spring-boot-tools\spring-boot-gradle-plugin\target\refdocs\asciidoc\spring-doc-resources-0.1.3.RELEASE.zip: archive is not a ZIP archive -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <args> -rf :spring-boot-gradle-plugin

则执行 :

mvn clean -rf :spring-boot-gradle-plugin

在这里插入图片描述

构建成功 :

在这里插入图片描述

项目构建

在源码项目下搭建一个测试模块 :

spring-boot-tests

学习博客

SpringBoot自动装配原理

配置类的加载及FilteringSpringBootCondition执行逻辑及@EnableAutoConfiguration

SpringBoot自动装配原理-ConfigurationClassPostProcessor

SpringBoot中Tomcat等服务的启动时机

SpringBoot中Tomcat等服务的启动时机

配置文件加载时机

Environment加载源码

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值