Java中SpringBoot四大核心组件是什么

一、Spring Boot Starter

java 复制代码
1.1 Starter的应用示例
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
<dependency>
    <groupId>org.mybatis.spring.boot</groupId>
    <artifactId>mybatis-spring-boot-starter</artifactId>
    <version>1.3.2</version>
</dependency>

在我们的Spring Boot项目种的POM文件中总会看到这两种依赖:

java 复制代码
spring-boot-starter-xxx 和 xxx-spring-boot-starter。

这就是spring boot的四大组件之一的starter。

官方提供的starter是这样的:spring-boot-starter-xxx

非官方的starter是这样的:xxx-spring-boot-starter

总结:

a、Starter 帮我们封装好了所有需要的依赖,避免我们自己添加导致的一些Jar包冲突或者缺少包的情况;

b、Starter帮我们自动注入了需要的Bean实例到Spring 容器中,不需要我们手动配置(这个可以说是starter干的,实际上并不是,这里埋个坑,下面解答);

所以: starter包的内容就是pom文件,就是一个依赖传递包。

二、Spring Boot Autoconfigure

2.1 autoconfigure 简介

autoconfigure在我们的开发中并不会被感知,因为它是存在与我们的starter中的。所以我们的每个starter都是依赖autoconfigure的:

三、Spring Boot CLI

Spring Boot CLI是一个命令行应用Spring Boot的客户端工具;次要性能如下:

运行groovy脚本 => 官网2.1

打包groovy文件到jar => 官网2.3

初始化Spring Boot我的项目 => 官网2.4

其余

四、Spring Boot actuator

actuator是Spring Boot的监控插件,自身提供了很多接口能够获取以后我的项目的各项运行状态指标。

相关推荐
Ramble_Naylor28 分钟前
async/await:让一个线程同时等很多件事
开发语言·rust
ZealSinger36 分钟前
Spring7 RestTemplate弃用迁移
java·spring·后端开发·restclient
迅猛龙办公室1 小时前
Python实现绘制同切圆
开发语言·python
朝朝辞暮i1 小时前
C++ 第 13 课:值传递 —— 为什么函数里改了,外面却没变?
java·c++·算法
弹简特1 小时前
【Java项目-企悦抽】16-抽奖模块01-获取活动完整信息接口实现
java·开发语言·状态模式·springboot
言乐61 小时前
Python语音检索
开发语言·python·django·virtualenv·pygame
BD_Marathon2 小时前
多轮对话聊天机器人
开发语言·机器人·c#
泡茶喝茶写代码2 小时前
A股量化数据工程:从 REST 接口到策略信号(第 1 篇):指数列表与实时行情接入
java·python·股票数据api·股票数据·股票数据api接口·股票api数据接口·股票量化数据接口
Sarvartha2 小时前
接口基础知识
java·开发语言
沐晓时光2 小时前
C语言入门,深入理解指针(1)
c语言·开发语言