
最近在帮团队筛选简历和面试候选人发现很多同学在简历上写“精通SpringBoot”但一问到实际项目中的深度应用和问题排查就卡壳了。SpringBoot作为Java后端开发的基石早已不是“会启动项目、写个Controller”就能应付面试的。尤其在当前竞争环境下面试官更看重你能否用SpringBoot解决真实、复杂的工程问题。本文不聊八股文而是结合高频面试考点和实际项目经验整理了一份从“会用”到“懂原理、能实战、会优化”的SpringBoot进阶实战清单。如果你能跟着本文的思路把每个模块都动手练到“知其然并知其所以然”的程度相信在接下来的面试中无论是项目深挖还是原理阐述都能让你脱颖而出稳稳拿下心仪的offer。1. SpringBoot 面试进阶核心从 CRUD 到工程化思维很多同学对SpringBoot的认知停留在“快速启动”、“简化配置”层面。面试时如果你只能说出自动装配、起步依赖那仅仅是及格线。真正的加分项在于你能将SpringBoot的特性与高并发、高可用、可维护、可观测的工程化需求结合起来。面试官想考察什么深度原理理解不仅知道怎么用还要知道为什么这么设计如自动装配的源码流程、条件装配的生效机制。实战问题解决能力遇到线上OOM、接口超时、配置不生效、循环依赖等问题你的排查思路是什么工程化应用能力如何利用SpringBoot生态如Actuator、Spring Cloud构建健壮的生产级应用性能与优化意识你的项目中有哪些针对性的优化点如连接池配置、JVM参数、缓存策略。接下来我们将围绕这些核心考察点分模块进行深度拆解和实战演练。2. 环境准备与版本说明工欲善其事必先利其器。一个稳定、一致的开发环境是后续所有练习的基础。基础环境操作系统Windows 10/11, macOS, 或 Linux (如 Ubuntu 20.04)。本文命令以Linux/macOS为主Windows用户请使用PowerShell或WSL。JavaJDK 17 (LTS)。这是当前企业级开发的主流选择兼容性和新特性支持都很好。确保java -version输出正确。java -version # 预期输出类似openjdk version 17.0.10 2024-01-16构建工具Maven 3.8或Gradle 7.6。本文以Maven为例。mvn -v # 预期输出包含 Apache Maven 3.8.xIDEIntelliJ IDEA Ultimate/Community Edition或Eclipse with STS。IDEA对SpringBoot支持更友好。数据库MySQL 8.0用于数据持久化示例。其他工具Postman或curl用于API测试Git用于版本管理。SpringBoot版本我们使用Spring Boot 2.7.18(当前2.x系列的最后一个功能版本稳定且资料丰富) 或Spring Boot 3.2.x(如果你希望体验最新特性如GraalVM原生镜像)。两者核心思想一致部分配置和依赖名有差异文中会做说明。初始化项目使用 Spring Initializr 或 IDEA 内置工具创建项目。Project: MavenLanguage: JavaSpring Boot: 2.7.18Packaging: JarJava: 17Dependencies: 我们先选择最基础的Spring Web。生成后项目结构应类似demo-project ├── src │ ├── main │ │ ├── java │ │ │ └── com │ │ │ └── example │ │ │ └── demo │ │ │ └── DemoApplication.java │ │ └── resources │ │ ├── application.properties │ │ └── static/ templates/ │ └── test/... ├── pom.xml └── ...3. 核心模块一自动装配与自定义 Starter这是SpringBoot面试的必考题不能只背概念要能画图、能追踪源码、能自己实现。3.1 自动装配原理深度拆解面试常问“SpringBoot的自动装配是怎么实现的”初级回答通过SpringBootApplication下的EnableAutoConfiguration和spring.factories文件。进阶回答需要清晰描述整个链条。起点SpringBootApplication是一个组合注解包含了EnableAutoConfiguration。关键注解EnableAutoConfiguration通过Import(AutoConfigurationImportSelector.class)导入选择器。加载逻辑AutoConfigurationImportSelector调用getCandidateConfigurations()方法。配置来源该方法利用SpringFactoriesLoader从所有依赖jar包的META-INF/spring.factories文件中读取org.springframework.boot.autoconfigure.EnableAutoConfiguration键对应的全限定类名列表。过滤机制加载的配置类不会全部生效。每个配置类通常用ConditionalOnClass,ConditionalOnMissingBean,ConditionalOnProperty等条件注解进行过滤只有条件满足时对应的Configuration类才会被真正解析其中的Bean方法才会被执行从而向容器注册Bean。动手验证在项目中添加spring-boot-autoconfigure依赖通常已传递依赖查看其META-INF/spring.factories文件。# 在项目根目录下执行 find . -name spring.factories -type f | xargs grep -l EnableAutoConfiguration你会看到类似如下的条目SpringBoot 2.7 后部分已迁移到META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports但原理相通org.springframework.boot.autoconfigure.EnableAutoConfiguration\ org.springframework.boot.autoconfigure.web.servlet.DispatcherServletAutoConfiguration,\ org.springframework.boot.autoconfigure.web.servlet.error.ErrorMvcAutoConfiguration,\ ...3.2 实现一个自定义 Starter这是证明你理解自动装配的最佳方式。我们创建一个简单的“短信服务” Starter。步骤1创建Starter项目module在父工程下新建一个Maven模块命名为my-sms-spring-boot-starter。!-- pom.xml -- ?xml version1.0 encodingUTF-8? project xmlnshttp://maven.apache.org/POM/4.0.0 xmlns:xsihttp://www.w3.org/2001/XMLSchema-instance xsi:schemaLocationhttp://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd modelVersion4.0.0/modelVersion parent groupIdcom.example/groupId artifactIddemo-parent/artifactId version1.0.0/version /parent artifactIdmy-sms-spring-boot-starter/artifactId version1.0.0/version properties maven.compiler.source17/maven.compiler.source maven.compiler.target17/maven.compiler.target /properties dependencies !-- 必须依赖 autoconfigure -- dependency groupIdorg.springframework.boot/groupId artifactIdspring-boot-autoconfigure/artifactId /dependency !-- 可选配置元数据注解处理器让IDE能提示我们在application.properties中的自定义配置 -- dependency groupIdorg.springframework.boot/groupId artifactIdspring-boot-configuration-processor/artifactId optionaltrue/optional /dependency /dependencies /project步骤2定义配置属性类// 文件src/main/java/com/example/sms/autoconfigure/SmsProperties.java package com.example.sms.autoconfigure; import org.springframework.boot.context.properties.ConfigurationProperties; ConfigurationProperties(prefix sms) public class SmsProperties { /** * 短信服务商访问密钥ID */ private String accessKeyId; /** * 短信服务商访问密钥Secret */ private String accessKeySecret; /** * 短信签名 */ private String signName; /** * 服务端点可选用于兼容不同区域 */ private String endpoint dysmsapi.aliyuncs.com; // getters and setters 省略实际必须生成 }步骤3定义核心服务类// 文件src/main/java/com/example/sms/autoconfigure/SmsService.java package com.example.sms.autoconfigure; public class SmsService { private final SmsProperties properties; public SmsService(SmsProperties properties) { this.properties properties; } public boolean send(String phoneNumber, String templateCode, String templateParam) { // 这里模拟发送逻辑实际应调用第三方SDK System.out.printf([SmsService] 准备发送短信 to %s, 使用AK: %s, 签名: %s%n, phoneNumber, properties.getAccessKeyId(), properties.getSignName()); System.out.printf( 模板: %s, 参数: %s%n, templateCode, templateParam); // 模拟发送成功 return true; } }步骤4编写自动配置类// 文件src/main/java/com/example/sms/autoconfigure/SmsAutoConfiguration.java package com.example.sms.autoconfigure; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; Configuration ConditionalOnClass(SmsService.class) // 当类路径下存在SmsService时本配置类才生效 EnableConfigurationProperties(SmsProperties.class) // 使SmsProperties生效并注入到容器 ConditionalOnProperty(prefix sms, name enabled, havingValue true, matchIfMissing true) // 当 sms.enabledtrue 或未配置时生效 public class SmsAutoConfiguration { Bean ConditionalOnMissingBean // 当容器中不存在SmsService类型的Bean时才创建避免重复 public SmsService smsService(SmsProperties properties) { return new SmsService(properties); } }步骤5注册自动配置类在src/main/resources/META-INF/下创建spring.factories文件。org.springframework.boot.autoconfigure.EnableAutoConfiguration\ com.example.sms.autoconfigure.SmsAutoConfiguration(对于SpringBoot 2.7更推荐在META-INF/spring/下创建org.springframework.boot.autoconfigure.AutoConfiguration.imports文件内容只需一行com.example.sms.autoconfigure.SmsAutoConfiguration)步骤6在主项目中使用在主项目的pom.xml中引入自定义starter。dependency groupIdcom.example/groupId artifactIdmy-sms-spring-boot-starter/artifactId version1.0.0/version /dependency在application.properties中配置。# 自定义Starter配置 sms.enabledtrue sms.access-key-idyour-ak-id sms.access-key-secretyour-ak-secret sms.sign-name阿里云短信测试 # sms.endpoint 使用默认值在Controller或Service中注入使用。RestController RequestMapping(/api/sms) public class SmsController { Autowired private SmsService smsService; PostMapping(/send) public String sendSms(RequestParam String phone) { boolean success smsService.send(phone, SMS_123456789, {\code\:\123456\}); return success ? 发送成功 : 发送失败; } }面试亮点完成这个练习后你可以清晰地阐述Conditional系列注解的作用、spring.factories/AutoConfiguration.imports的机制以及如何设计一个可配置、可插拔的Starter。4. 核心模块二生产就绪特性 (Actuator) 与监控线上应用的健康状况、指标、环境信息如何获取Spring Boot Actuator 是标准答案。4.1 Actuator 基础集成与端点暴露添加依赖dependency groupIdorg.springframework.boot/groupId artifactIdspring-boot-starter-actuator/artifactId /dependency配置端点暴露与安全非常重要默认情况下只有health和info端点通过HTTP暴露。在生产环境必须谨慎管理端点的访问权限。# application.yml management: endpoints: web: exposure: include: health, info, metrics, env, beans, mappings # 明确指定需要暴露的端点 # exclude: * # 或者用排除法 base-path: /manage # 自定义管理端点路径避免与业务接口冲突 endpoint: health: show-details: when_authorized # 健康详情只对授权用户显示 shutdown: enabled: false # 生产环境务必关闭shutdown端点访问示例启动应用后访问http://localhost:8080/manage/health查看健康状态http://localhost:8080/manage/metrics查看指标。4.2 自定义健康指示器 (HealthIndicator)当你的应用依赖外部服务如数据库、Redis、第三方API时自定义健康检查能提供更精准的状态。// 文件src/main/java/com/example/demo/health/CustomRedisHealthIndicator.java package com.example.demo.health; import org.springframework.boot.actuate.health.Health; import org.springframework.boot.actuate.health.HealthIndicator; import org.springframework.stereotype.Component; import java.net.Socket; Component // 自动注册为HealthIndicator public class CustomRedisHealthIndicator implements HealthIndicator { private final String host localhost; private final int port 6379; Override public Health health() { // 实际项目中这里应该注入一个RedisTemplate或Lettuce连接对象进行检测 try (Socket socket new Socket(host, port)) { if (socket.isConnected()) { return Health.up() .withDetail(host, host) .withDetail(port, port) .withDetail(message, Redis connection successful) .build(); } else { return Health.down() .withDetail(host, host) .withDetail(port, port) .withDetail(error, Connection refused) .build(); } } catch (Exception e) { return Health.down(e) .withDetail(host, host) .withDetail(port, port) .withDetail(error, e.getMessage()) .build(); } } }访问/manage/health输出会包含redis组件状态。4.3 自定义度量指标 (MeterRegistry)利用Micrometer收集业务指标集成到PrometheusGrafana。// 文件src/main/java/com/example/demo/service/OrderService.java package com.example.demo.service; import io.micrometer.core.instrument.Counter; import io.micrometer.core.instrument.MeterRegistry; import org.springframework.stereotype.Service; import javax.annotation.PostConstruct; Service public class OrderService { private final MeterRegistry meterRegistry; private Counter orderCreateCounter; private Counter orderCreateErrorCounter; public OrderService(MeterRegistry meterRegistry) { this.meterRegistry meterRegistry; } PostConstruct public void init() { // 定义计数器订单创建成功 orderCreateCounter Counter.builder(order.create.total) .description(Total number of orders created) .tag(status, success) // 用标签区分维度 .register(meterRegistry); // 定义计数器订单创建失败 orderCreateErrorCounter Counter.builder(order.create.total) .description(Total number of orders created) .tag(status, error) .register(meterRegistry); } public void createOrder(Order order) { try { // 业务逻辑... orderCreateCounter.increment(); // 成功时递增 } catch (Exception e) { orderCreateErrorCounter.increment(); // 失败时递增 throw e; } } }添加Prometheus依赖后 (spring-boot-starter-actuator和micrometer-registry-prometheus)访问/manage/prometheus即可获取指标数据。面试亮点你能说出Actuator的核心端点、如何保护它们、如何扩展健康检查和业务指标并提到与监控系统如Prometheus的集成这体现了你的运维意识和工程能力。5. 核心模块三外部化配置与多环境管理“你的测试环境数据库连哪里”——这是一个真实面试题。配置管理是项目质量的体现。5.1 配置优先级与ConfigurationPropertiesSpringBoot配置加载优先级从高到低命令行参数 (--server.port8081)SPRING_APPLICATION_JSON环境变量java:comp/env中的JNDI属性Java系统属性 (-Dserver.port8082)操作系统环境变量random.*属性Profile-specific 配置文件(application-{profile}.properties/yml)打包在jar外的Profile-specific配置文件打包在jar内的Profile-specific配置文件打包在jar外的应用配置文件(application.properties/yml)打包在jar内的应用配置文件Configuration类上的PropertySource默认属性 (通过SpringApplication.setDefaultProperties设置)最佳实践使用ConfigurationProperties进行类型安全绑定。// 1. 定义配置类 // 文件src/main/java/com/example/demo/config/AppConfigProperties.java package com.example.demo.config; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.stereotype.Component; import org.springframework.validation.annotation.Validated; import javax.validation.constraints.NotBlank; import javax.validation.constraints.Min; Component ConfigurationProperties(prefix app) Validated // 开启JSR-303验证 public class AppConfigProperties { NotBlank private String name; Min(1) private int workerThreads 10; private Security security new Security(); // 嵌套对象 public static class Security { private String secretKey; private long tokenExpireSeconds 3600; // getters and setters } // getters and setters } // 2. 在 application.yml 中配置 app: name: My SpringBoot App worker-threads: 20 security: secret-key: my-secure-key-123 token-expire-seconds: 7200 // 3. 在Service中注入使用 Service public class MyService { private final AppConfigProperties appConfig; public MyService(AppConfigProperties appConfig) { this.appConfig appConfig; System.out.println(App Name: appConfig.getName()); } }5.2 多环境配置 (Profile)配置文件组织src/main/resources/ ├── application.yml # 主配置放通用和默认配置 ├── application-dev.yml # 开发环境 ├── application-test.yml # 测试环境 └── application-prod.yml # 生产环境application.yml内容spring: profiles: active: activatedProperties # Maven占位符配合maven profile动态激活 app: name: demo-app --- # 开发环境通用配置 (可选) spring: config: activate: on-profile: dev logging: level: com.example.demo: DEBUGapplication-prod.yml内容spring: config: activate: on-profile: prod datasource: url: jdbc:mysql://prod-db-host:3306/demo?useSSLtrueserverTimezoneUTC username: ${DB_USER:prod_user} password: ${DB_PASSWORD} hikari: maximum-pool-size: 20 connection-timeout: 30000 logging: level: com.example.demo: INFO file: name: /var/log/demo/app.log激活方式命令行java -jar app.jar --spring.profiles.activeprod环境变量export SPRING_PROFILES_ACTIVEprodJVM参数-Dspring.profiles.activeprodMaven Profile(配合activatedProperties)profiles profile iddev/id activationactiveByDefaulttrue/activeByDefault/activation properties activatedPropertiesdev/activatedProperties /properties /profile profile idprod/id properties activatedPropertiesprod/activatedProperties /properties /profile /profiles打包时使用mvn clean package -P prod面试亮点清晰阐述配置优先级、Profile的使用场景、如何安全地管理生产环境密码如使用环境变量或配置中心并展示类型安全的配置绑定方式。6. 核心模块四高级特性与性能优化6.1 异步处理与Async对于耗时操作如发送邮件、处理文件使用异步提升接口响应速度。// 1. 在主类或配置类上开启异步支持 SpringBootApplication EnableAsync // 启用异步 public class DemoApplication { public static void main(String[] args) { SpringApplication.run(DemoApplication.class, args); } } // 2. 配置自定义线程池避免使用默认的SimpleAsyncTaskExecutor Configuration public class AsyncConfig { Bean(taskExecutor) public Executor taskExecutor() { ThreadPoolTaskExecutor executor new ThreadPoolTaskExecutor(); executor.setCorePoolSize(5); executor.setMaxPoolSize(10); executor.setQueueCapacity(100); executor.setThreadNamePrefix(Async-); executor.initialize(); return executor; } } // 3. 在Service方法上使用Async Service public class EmailService { Async(taskExecutor) // 指定线程池Bean名称 public CompletableFutureString sendWelcomeEmail(String to) { // 模拟耗时操作 try { Thread.sleep(3000); System.out.println(Thread.currentThread().getName() : 邮件已发送至 to); } catch (InterruptedException e) { Thread.currentThread().interrupt(); } return CompletableFuture.completedFuture(success); } } // 4. 在Controller中调用 RestController public class UserController { Autowired private EmailService emailService; PostMapping(/register) public ResponseEntityString register(RequestBody User user) { // 主线程立即返回邮件发送异步执行 emailService.sendWelcomeEmail(user.getEmail()); return ResponseEntity.ok(注册成功欢迎邮件发送中...); } }6.2 缓存抽象与Cacheable合理使用缓存是提升性能最有效的手段之一。// 1. 添加缓存依赖 (如Caffeine) dependency groupIdorg.springframework.boot/groupId artifactIdspring-boot-starter-cache/artifactId /dependency dependency groupIdcom.github.ben-manes.caffeine/groupId artifactIdcaffeine/artifactId /dependency // 2. 启用缓存 SpringBootApplication EnableCaching public class DemoApplication { ... } // 3. 配置缓存application.yml spring: cache: type: caffeine caffeine: spec: maximumSize500, expireAfterWrite10m // 4. 在Service中使用缓存 Service public class ProductService { Cacheable(value products, key #id) // 缓存名为productskey为id public Product getProductById(Long id) { // 模拟数据库查询 System.out.println(查询数据库获取产品ID: id); return productRepository.findById(id).orElse(null); } CacheEvict(value products, key #id) // 删除缓存 public void updateProduct(Product product) { productRepository.save(product); } CacheEvict(value products, allEntries true) // 清空整个products缓存 public void reloadAllProducts() { // ... } }6.3 连接池配置优化 (HikariCP)SpringBoot默认使用HikariCP生产环境必须优化。spring: datasource: hikari: # 连接池大小 ((core_count * 2) effective_spindle_count) # 对于常规OLTP建议公式connections ((core * 2) disk_count) # 例如 4核1磁盘 ((4*2)1)9。可设为10-20。 maximum-pool-size: 20 minimum-idle: 10 # 不建议等于maximum-pool-size根据负载调整 # 连接超时毫秒 connection-timeout: 30000 # 30秒必须大于数据库的wait_timeout # 连接最大生命周期毫秒 max-lifetime: 1800000 # 30分钟小于数据库的wait_timeout # 空闲连接超时毫秒 idle-timeout: 600000 # 10分钟 # 连接测试查询 connection-test-query: SELECT 1 # 连接泄漏检测阈值毫秒 leak-detection-threshold: 60000 # 60秒生产环境可适当调大或关闭(0)面试亮点能说出Async默认线程池的问题及自定义方法、缓存注解的使用场景和失效策略、HikariCP关键参数的含义及设置依据表明你具备性能调优的实战经验。7. 核心模块五常见生产问题排查思路面试官喜欢问“你遇到过什么问题怎么解决的”。7.1 应用启动失败问题现象APPLICATION FAILED TO START排查步骤看日志完整错误堆栈是关键。重点关注Caused by:后面的根本原因。检查依赖冲突mvn dependency:tree查看依赖树使用mvn dependency:analyze分析。mvn dependency:tree -Dincludescom.fasterxml.jackson.core # 检查特定依赖检查配置特别是application.yml/properties格式缩进、冒号后空格、属性名拼写。检查Bean创建常见的如循环依赖Requested bean is currently in creation、Autowired找不到Bean、Value注入失败。检查端口占用Address already in use。7.2 接口响应慢或超时排查步骤定位慢接口使用Actuator的metrics端点或集成SkyWalking、Pinpoint等APM工具。分析线程栈jstack pid或使用Arthas的thread命令查看是否有线程阻塞在IO、锁、或慢SQL上。检查数据库是否是慢SQL导致使用EXPLAIN分析SQL执行计划。检查连接池是否耗尽HikariPool - Timeout。检查外部调用调用第三方API或内部其他服务是否超时考虑添加超时设置和熔断降级如Resilience4j、Sentinel。检查GC是否频繁Full GC使用jstat -gc pid 1000观察。7.3 内存泄漏与 OOM问题现象java.lang.OutOfMemoryError: Java heap space排查步骤导出堆转储在JVM参数中添加-XX:HeapDumpOnOutOfMemoryError -XX:HeapDumpPath/path/to/dump.hprof。使用工具分析MAT (Eclipse Memory Analyzer) 或 JProfiler 加载.hprof文件查看Dominator Tree或Leak Suspects找到占用内存最大的对象和引用链。常见原因静态集合类持续增长如全局的Map、List缓存了数据未清理。线程局部变量未释放ThreadLocal使用后未调用remove()。数据库连接/文件流未关闭确保在finally块或使用 try-with-resources 关闭。不合理的缓存策略缓存了过多数据或未设置过期时间。7.4 配置不生效排查步骤确认配置位置和优先级回顾第5部分的配置优先级检查配置是否被更高优先级的覆盖。检查Profile是否激活management.env端点查看所有属性源和最终生效的值。检查RefreshScope如果使用配置中心如Nacos、Apollo并期望动态刷新确保相关Bean标注了RefreshScope且配置中心客户端配置正确。检查属性绑定ConfigurationProperties或Value的字段名是否与配置文件中的kebab-case(如my-property) 正确映射到camelCase(如myProperty)。8. 面试实战项目经验阐述与原理阐述当被问到“讲讲你的SpringBoot项目”时不要只罗列功能。结构化回答STAR法则变体项目背景与职责简要说明项目是做什么的你在其中负责哪些模块。技术架构与选型说明为什么选SpringBoot快速开发、生态丰富以及与之搭配的技术栈MyBatis-Plus, Redis, RabbitMQ等。深度实践举例例1配置管理“为了应对多环境部署我基于Spring Profiles设计了application-dev/test/prod.yml配置体系关键密码通过环境变量注入并通过ConfigurationProperties进行类型安全绑定提升了配置的可维护性和安全性。”例2性能优化“在订单查询模块我发现热点数据频繁访问数据库。通过分析我引入了Spring Cache抽象并集成了Caffeine本地缓存使用Cacheable注解将接口平均响应时间从200ms降低到了20ms。同时我配置了合理的缓存失效策略保证了数据一致性。”例3问题排查“有一次线上服务出现间歇性超时。我通过Actuator的metrics端点定位到是某个第三方接口调用慢进而使用Async配合自定义线程池将其异步化并在外层增加了Resilience4j的熔断和超时控制隔离了故障提升了系统整体稳定性。”总结与反思通过这个项目你加深了对SpringBoot自动装配、外部化配置、监控等特性的理解并积累了性能优化和问题排查的经验。原理阐述要点当被问到“SpringBoot自动装配原理”时可以这样回答 “SpringBoot的自动装配核心是EnableAutoConfiguration注解。它通过Import导入了AutoConfigurationImportSelector。这个选择器会调用SpringFactoriesLoader从类路径下所有jar包的META-INF/spring.factories或SpringBoot 2.7的META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports文件中读取EnableAutoConfiguration对应的全限定类名列表。这些类都是Configuration配置类但它们并不会全部生效。每个配置类上都有大量的ConditionalOnXxx条件注解比如ConditionalOnClass类路径下存在某个类、ConditionalOnMissingBean容器中不存在某个Bean。只有满足所有条件的配置类才会被解析其内部定义的Bean方法才会执行从而将需要的组件注册到Spring容器中。这种‘约定大于配置’的机制使得我们只需引入starter依赖就能获得一个开箱即用的功能环境。”将上述所有模块的知识点融会贯通动手实践并形成自己的理解和表述你就能在SpringBoot相关的面试中展现出远超普通候选人的深度和广度。面试不仅是知识的复述更是解决问题思路和工程化能力的展示。祝你面试顺利拿下心仪的Offer