Feature Article

SpringBoot 官方文档翻译 21 — SpringApplication

Spring Boot 官方文档翻译系列:SpringApplication 启动、失败分析、可用性、事件、退出与虚拟线程。

SERIES 《SpringBoot翻译》 第 21 篇 共 211 篇
分类

SpringApplication

原文:https://docs.spring.io/spring-boot/reference/features/spring-application.html (Spring Boot 4.2.0)

SpringApplication 类提供了一种便捷的方式来引导从 main() 方法启动的 Spring 应用。很多时候,你可以委托给静态的 SpringApplication.run(Class, String...) 方法,如以下示例所示:

@SpringBootApplication
public class MyApplication {

	public static void main(String[] args) {
		SpringApplication.run(MyApplication.class, args);
	}
}

应用启动时,你会看到类似以下的输出:

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::                (v4.2.0)
...

默认情况下会显示 INFO 级别的日志,包括一些相关的启动细节,例如启动应用的用户。如果需要其他日志级别,可以进行设置,参见日志级别。应用版本根据主应用类所在包的 implementation version 确定。通过将 spring.main.log-startup-info 设置为 false 可以关闭启动信息日志,这也会关闭应用活动 profile 的日志。

要在启动期间添加额外的日志,可以在 SpringApplication 的子类中覆盖 logStartupInfo(boolean)。

启动失败

如果应用启动失败,已注册的 FailureAnalyzer bean 有机会提供专门的错误消息和具体的修复建议。例如,如果在端口 8080 上启动 Web 应用而该端口已被占用,你会看到类似以下消息:

***************************
APPLICATION FAILED TO START
***************************

Description:

Embedded servlet container failed to start. Port 8080 was already in use.

Action:

Identify and stop the process that is listening on port 8080 or configure this application to listen on another port.

Spring Boot 提供了大量 FailureAnalyzer 实现,你也可以添加自己的。

如果没有任何失败分析器能够处理该异常,你仍可以显示完整的条件报告以更好地了解问题所在。为此,需要启用 debug 属性或为 ConditionEvaluationReportLoggingListener 启用 DEBUG 日志。例如,通过 java -jar 运行应用时,可以这样启用 debug 属性:

$ java -jar myproject-0.0.1-SNAPSHOT.jar --debug

延迟初始化

SpringApplication 允许应用延迟初始化。启用延迟初始化后,bean 在需要时才创建,而不是在应用启动期间创建。因此,启用延迟初始化可以减少应用启动时间。在 Web 应用中,启用延迟初始化会导致许多 Web 相关的 bean 直到收到 HTTP 请求才被初始化。

延迟初始化的一个缺点是它可能延迟发现应用中的问题。如果配置错误的 bean 被延迟初始化,启动期间将不再发生失败,问题只会在该 bean 初始化时才显现。还必须注意确保 JVM 有足够的内存来容纳应用的所有 bean,而不仅仅是启动期间初始化的那些。基于这些原因,延迟初始化默认不启用,建议在启用延迟初始化之前先精细调整 JVM 的堆大小。

延迟初始化可以通过 SpringApplicationBuilder 的 lazyInitialization 方法或 SpringApplication 的 setLazyInitialization 方法以编程方式启用。也可以使用 spring.main.lazy-initialization 属性启用:

spring.main.lazy-initialization=true

如果希望对某些 bean 禁用延迟初始化而对应用的其余部分使用延迟初始化,可以使用 @Lazy(false) 注解显式将其 lazy 属性设置为 false。

定制横幅

启动时打印的横幅可以通过在 classpath 中添加 banner.txt 文件,或将 spring.banner.location 属性设置为该文件的位置来更改。如果文件编码不是 UTF-8,可以设置 spring.banner.charset。

在 banner.txt 文件中,可以使用 Environment 中的任何 key,以及以下占位符:

表 1. 横幅变量

变量描述
${application.version}应用版本号,在 MANIFEST.MF 中声明。例如 Implementation-Version: 1.0 打印为 1.0。
${application.formatted-version}应用版本号,在 MANIFEST.MF 中声明并格式化以显示(用括号包围并加 v 前缀),例如 (v1.0)。
${spring-boot.version}正在使用的 Spring Boot 版本,例如 4.2.0。
${spring-boot.formatted-version}正在使用的 Spring Boot 版本,格式化以显示,例如 (v4.2.0)。
${application.title}应用标题,在 MANIFEST.MF 中声明。

也可以通过编程方式使用 SpringApplication.setBanner(…) 方法生成横幅。

定制 SpringApplication

如果 SpringApplication 的默认设置不合你意,可以创建本地实例并对其进行定制。例如,要关闭横幅,可以这样写:

@SpringBootApplication
public class MyApplication {

	public static void main(String[] args) {
		SpringApplication application = new SpringApplication(MyApplication.class);
		application.setBannerMode(Banner.Mode.OFF);
		application.run(args);
	}
}

传递给 SpringApplication 的构造器参数是 Spring bean 的配置源。大多数情况下,这些是对 @Configuration 类的引用,但也可以是对 @Component 类的直接引用。

也可以使用 application.properties 文件配置 SpringApplication,详见外部化配置。完整的配置选项列表请参阅 API 文档。

流式 Builder API

如果需要构建 ApplicationContext 层次结构(具有父/子关系的多个上下文),或者更喜欢使用流式 builder API,可以使用 SpringApplicationBuilder。

它允许将多个方法调用链接在一起,并包含 parent 和 child 方法用于创建层次结构,如以下示例所示:

new SpringApplicationBuilder().sources(Parent.class)
			.child(Application.class)
			.bannerMode(Banner.Mode.OFF)
			.run(args);

创建 ApplicationContext 层次结构有一些限制。例如,Web 组件必须包含在子上下文中,并且父上下文和子上下文使用相同的 Environment。

应用可用性

部署到平台时,应用可以使用 Kubernetes Probes 等基础设施向平台提供其可用性信息。Spring Boot 内置支持常用的"存活"(liveness)和"就绪"(readiness)可用性状态。如果使用 Spring Boot 的 actuator 支持,这些状态会作为健康端点组暴露。此外,也可以通过将 ApplicationAvailability 接口注入自己的 bean 来获取可用性状态。

存活状态

应用的"存活"状态表明其内部状态是否允许其正常工作,或者在当前失败时是否能自行恢复。存活状态损坏意味着应用处于无法恢复的状态,基础设施应重启应用。

一般而言,"存活"状态不应基于外部检查(如健康检查)。如果基于外部检查,外部系统(数据库、Web API、外部缓存)的故障将触发大规模重启和平台范围的级联故障。

Spring Boot 应用的内部状态主要由 Spring ApplicationContext 表示。如果应用上下文成功启动,Spring Boot 认为应用处于有效状态。上下文一旦刷新完成,应用即被视为存活。

就绪状态

应用的"就绪"状态表明应用是否准备好处理流量。就绪状态失败告诉平台暂时不应将流量路由到该应用。这通常发生在启动期间(处理 CommandLineRunner 和 ApplicationRunner 组件时),或者当应用认为自身太忙而无法处理更多流量时。一旦应用和命令行 runner 被调用,应用即被视为就绪。

预期在启动期间运行的任务应由 CommandLineRunner 和 ApplicationRunner 组件执行,而不是使用 Spring 组件生命周期回调(如 @PostConstruct)。

管理应用可用性状态

应用组件可以通过注入 ApplicationAvailability 接口并调用其方法,随时检索当前可用性状态。更常见的是,应用希望监听状态更新或更新应用状态。例如,可以将应用的"就绪"状态导出到文件,以便 Kubernetes "exec Probe" 查看该文件:

@Component
public class MyReadinessStateExporter {

	@EventListener
	public void onStateChange(AvailabilityChangeEvent<ReadinessState> event) {
		switch (event.getState()) {
			case ACCEPTING_TRAFFIC -> { /* 创建文件 /tmp/healthy */ }
			case REFUSING_TRAFFIC -> { /* 删除文件 /tmp/healthy */ }
		}
	}
}

当应用损坏且无法恢复时,也可以更新应用状态:

@Component
public class MyLocalCacheVerifier {

	private final ApplicationEventPublisher eventPublisher;

	public MyLocalCacheVerifier(ApplicationEventPublisher eventPublisher) {
		this.eventPublisher = eventPublisher;
	}

	public void checkLocalCache() {
		try {
			// ...
		}
		catch (CacheCompletelyBrokenException ex) {
			AvailabilityChangeEvent.publish(this.eventPublisher, ex, LivenessState.BROKEN);
		}
	}
}

Spring Boot 通过 Actuator 健康端点提供 Kubernetes "Liveness" 和 "Readiness" HTTP 探针。更多关于在 Kubernetes 上部署 Spring Boot 应用的指导请参阅专门章节。

应用事件与监听器

除了常规的 Spring Framework 事件(如 ContextRefreshedEvent),SpringApplication 还会发送一些额外的应用事件。

有些事件实际上在 ApplicationContext 创建之前触发,因此不能将它们作为 @Bean 注册监听器。可以使用 SpringApplication.addListeners(…) 方法或 SpringApplicationBuilder.listeners(…) 方法注册它们。

如果希望无论应用如何创建都自动注册这些监听器,可以在项目中添加 META-INF/spring.factories 文件,并使用 ApplicationListener key 引用你的监听器:

org.springframework.context.ApplicationListener=com.example.project.MyListener

应用运行时,事件按以下顺序发送:

Web 环境

SpringApplication 会尝试为你创建正确类型的 ApplicationContext。确定 WebApplicationType 的算法如下:

这意味着如果在同一应用中同时使用 Spring MVC 和 Spring WebFlux 的新 WebClient,默认将使用 Spring MVC。可以通过调用 setWebApplicationType(WebApplicationType) 轻松覆盖。也可以通过调用 setApplicationContextFactory(…) 完全控制所使用的 ApplicationContext 类型。

在 JUnit 测试中使用 SpringApplication 时,通常希望调用 setWebApplicationType(WebApplicationType.NONE)。

访问应用参数

如果需要访问传给 SpringApplication.run(…) 的应用参数,可以注入 ApplicationArguments bean。该接口提供对原始 String[] 参数以及解析后的 option 和 non-option 参数的访问:

@Component
public class MyBean {

	public MyBean(ApplicationArguments args) {
		boolean debug = args.containsOption("debug");
		List<String> files = args.getNonOptionArgs();
		if (debug) {
			System.out.println(files);
		}
		// 如果使用 "--debug logfile.txt" 运行,打印 ["logfile.txt"]
	}
}

Spring Boot 还会向 Spring Environment 注册一个 CommandLinePropertySource。这使你还可以使用 @Value 注解注入单个应用参数。

使用 ApplicationRunner 或 CommandLineRunner

如果需要在 SpringApplication 启动后运行某些特定代码,可以实现 ApplicationRunner 或 CommandLineRunner 接口。两个接口工作方式相同,都提供一个 run 方法,在 SpringApplication.run(…) 完成之前调用。

该契约非常适合应在应用启动之后但开始接受流量之前运行的任务。

CommandLineRunner 以字符串数组形式提供应用参数,而 ApplicationRunner 使用前面讨论的 ApplicationArguments 接口。如果定义了多个 runner bean 且需要按特定顺序调用,可以额外实现 Ordered 接口或使用 Order 注解。

应用退出

每个 SpringApplication 都会向 JVM 注册一个 shutdown hook,以确保 ApplicationContext 在退出时优雅关闭。所有标准的 Spring 生命周期回调(如 DisposableBean 接口或 @PreDestroy 注解)都可以使用。

此外,如果 bean 希望在调用 SpringApplication.exit() 时返回特定的退出码,可以实现 ExitCodeGenerator 接口。该退出码随后可以传给 System.exit() 作为状态码返回。异常也可以实现该接口。如果存在多个 ExitCodeGenerator,则使用生成的第一个非零退出码。要控制生成器的调用顺序,可额外实现 Ordered 接口或使用 Order 注解。

管理特性

可以通过指定 spring.application.admin.enabled 属性为应用启用管理相关特性。这会在平台 MBeanServer 上暴露 SpringApplicationAdminMXBean。你可以使用此特性远程管理 Spring Boot 应用,它对任何服务包装器实现也很有用。

应用启动跟踪

在应用启动期间,SpringApplication 和 ApplicationContext 会执行许多与应用生命周期、bean 生命周期甚至处理应用事件相关的任务。借助 ApplicationStartup,Spring Framework 允许你使用 StartupStep 对象跟踪应用启动序列。这些数据可用于性能分析,或只是为了更好地理解应用启动过程。

设置 SpringApplication 实例时可以选择 ApplicationStartup 实现。例如,要使用 BufferingApplicationStartup,可以这样写:

SpringApplication application = new SpringApplication(MyApplication.class);
application.setApplicationStartup(new BufferingApplicationStartup(2048));
application.run(args);

Spring Framework 提供的第一个可用实现是 FlightRecorderApplicationStartup。它将 Spring 特定的启动事件添加到 Java Flight Recorder 会话中,用于分析应用并将 Spring 上下文生命周期与 JVM 事件(分配、GC、类加载等)关联。配置后,可以通过启用 Flight Recorder 运行应用来记录数据:

$ java -XX:StartFlightRecording:filename=recording.jfr,duration=10s -jar demo.jar

Spring Boot 自带 BufferingApplicationStartup 变体,用于缓冲启动步骤并将其导出到外部指标系统。Spring Boot 还可以配置为暴露一个 startup 端点,以 JSON 文档形式提供这些信息。

虚拟线程

虚拟线程需要 Java 21 或更高版本。为获得最佳体验,强烈建议使用 Java 24 或更高版本。要启用虚拟线程,请将 spring.threads.virtual.enabled 属性设置为 true。

在开启此选项之前,建议阅读 Java 虚拟线程官方文档。在某些情况下,应用可能因"固定虚拟线程"(Pinned Virtual Threads)而出现吞吐量降低;该页面还解释了如何使用 JDK Flight Recorder 或 jcmd CLI 检测此类情况。

如果启用了虚拟线程,配置线程池的属性将不再起作用。这是因为虚拟线程调度在 JVM 全局平台线程池上,而不是专用线程池上。

虚拟线程的一个副作用是它们是守护线程。如果 JVM 的所有线程都是守护线程,JVM 将退出。当依赖 @Scheduled bean 保持应用存活时,这可能是个问题。如果使用虚拟线程,调度器线程是虚拟线程,因此是守护线程,不会保持 JVM 存活。要始终保证 JVM 继续运行,建议将 spring.main.keep-alive 属性设置为 true。

核心特性 外部化配置

SERIES / PATH

系列目录

查看系列页
  1. 第 1 篇 SpringBoot 官方文档翻译 01 — 概述 (Overview)
  2. 第 2 篇 SpringBoot 官方文档翻译 02 — 文档概览 (Documentation Overview)
  3. 第 3 篇 SpringBoot 官方文档翻译 03 — 社区 (Community)
  4. 第 4 篇 SpringBoot 官方文档翻译 04 — 系统要求 (System Requirements)
  5. 第 5 篇 SpringBoot 官方文档翻译 05 — 安装 Spring Boot (Installing Spring Boot)
  6. 第 6 篇 SpringBoot 官方文档翻译 06 — 升级 Spring Boot (Upgrading Spring Boot)
  7. 第 7 篇 SpringBoot 官方文档翻译 07 — 教程 (Tutorials)
  8. 第 8 篇 SpringBoot 官方文档翻译 08 — 开发第一个 Spring Boot 应用 (Developing Your First Spring Boot Application)
  9. 第 9 篇 SpringBoot 官方文档翻译 09 — 参考文档 (Reference)
  10. 第 10 篇 SpringBoot 官方文档翻译 10 — 使用 Spring Boot 进行开发 (Developing with Spring Boot)
  11. 第 11 篇 SpringBoot 官方文档翻译 11 — 构建系统 (Build Systems)
  12. 第 12 篇 SpringBoot 官方文档翻译 12 — 代码结构 (Structuring Your Code)
  13. 第 13 篇 SpringBoot 官方文档翻译 13 — 配置类 (Configuration Classes)
  14. 第 14 篇 SpringBoot 官方文档翻译 14 — 自动配置 (Auto-configuration)
  15. 第 15 篇 SpringBoot 官方文档翻译 15 — Spring Bean 与依赖注入 (Spring Beans and Dependency Injection)
  16. 第 16 篇 SpringBoot 官方文档翻译 16 — 使用 @SpringBootApplication 注解
  17. 第 17 篇 SpringBoot 官方文档翻译 17 — 运行你的应用 (Running Your Application)
  18. 第 18 篇 SpringBoot 官方文档翻译 18 — 开发工具 (Developer Tools)
  19. 第 19 篇 SpringBoot 官方文档翻译 19 — 为生产打包应用
  20. 第 20 篇 SpringBoot 官方文档翻译 20 — 核心特性 (Core Features)
  21. 第 21 篇 SpringBoot 官方文档翻译 21 — SpringApplication
  22. 第 22 篇 SpringBoot 官方文档翻译 22 — 外部化配置 (Externalized Configuration)
  23. 第 23 篇 SpringBoot 官方文档翻译 23 — Profile
  24. 第 24 篇 SpringBoot 官方文档翻译 24 — 日志 (Logging)
  25. 第 25 篇 SpringBoot 官方文档翻译 25 — 国际化 (Internationalization)
  26. 第 26 篇 SpringBoot 官方文档翻译 26 — 面向切面编程 (AOP)
  27. 第 27 篇 SpringBoot 官方文档翻译 27 — JSON
  28. 第 28 篇 SpringBoot 官方文档翻译 28 — 任务执行与调度 (Task Execution and Scheduling)
  29. 第 29 篇 SpringBoot 官方文档翻译 29 — 开发时服务 (Development-time Services)
  30. 第 30 篇 SpringBoot 官方文档翻译 30 — 创建你自己的自动配置 (Creating Your Own Auto-configuration)
  31. 第 31 篇 SpringBoot 官方文档翻译 31 — Kotlin 支持 (Kotlin Support)
  32. 第 32 篇 SpringBoot 官方文档翻译 32 — SSL
  33. 第 33 篇 SpringBoot 官方文档翻译 33 — Web
  34. 第 34 篇 SpringBoot 官方文档翻译 34 — Servlet Web 应用 (Servlet Web Applications)
  35. 第 35 篇 SpringBoot 官方文档翻译 35 — 响应式 Web 应用 (Reactive Web Applications)
  36. 第 36 篇 SpringBoot 官方文档翻译 36 — 优雅关闭 (Graceful Shutdown)
  37. 第 37 篇 SpringBoot 官方文档翻译 37 — Spring Security
  38. 第 38 篇 SpringBoot 官方文档翻译 38 — Spring Session
  39. 第 39 篇 SpringBoot 官方文档翻译 39 — Spring for GraphQL
  40. 第 40 篇 SpringBoot 官方文档翻译 40 — Spring HATEOAS
  41. 第 41 篇 SpringBoot 官方文档翻译 41 — 数据 (Data)
  42. 第 42 篇 SpringBoot 官方文档翻译 42 — SQL 数据库 (SQL Databases)
  43. 第 43 篇 SpringBoot 官方文档翻译 43 — 使用 NoSQL 技术 (Working with NoSQL Technologies)
  44. 第 44 篇 SpringBoot 官方文档翻译 44 — IO
  45. 第 45 篇 SpringBoot 官方文档翻译 45 — 缓存 (Caching)
  46. 第 46 篇 SpringBoot 官方文档翻译 46 — Spring Batch
  47. 第 47 篇 SpringBoot 官方文档翻译 47 — gRPC
  48. 第 48 篇 SpringBoot 官方文档翻译 48 — Hazelcast
  49. 第 49 篇 SpringBoot 官方文档翻译 49 — Quartz Scheduler
  50. 第 50 篇 SpringBoot 官方文档翻译 50 — 发送电子邮件 (Sending Email)
  51. 第 51 篇 SpringBoot 官方文档翻译 51 — 校验 (Validation)
  52. 第 52 篇 SpringBoot 官方文档翻译 52 — 调用 REST 服务 (Calling REST Services)
  53. 第 53 篇 SpringBoot 官方文档翻译 53 — Web Services
  54. 第 54 篇 SpringBoot 官方文档翻译 54 — 使用 JTA 的分布式事务
  55. 第 55 篇 SpringBoot 官方文档翻译 55 — 消息 (Messaging)
  56. 第 56 篇 SpringBoot 官方文档翻译 56 — JMS
  57. 第 57 篇 SpringBoot 官方文档翻译 57 — AMQP
  58. 第 58 篇 SpringBoot 官方文档翻译 58 — Apache Kafka 支持
  59. 第 59 篇 SpringBoot 官方文档翻译 59 — Apache Pulsar 支持
  60. 第 60 篇 SpringBoot 官方文档翻译 60 — RSocket
  61. 第 61 篇 SpringBoot 官方文档翻译 61 — Spring Integration
  62. 第 62 篇 SpringBoot 官方文档翻译 62 — WebSockets
  63. 第 63 篇 SpringBoot 官方文档翻译 63 — 安全 (Security)
  64. 第 64 篇 SpringBoot 官方文档翻译 64 — OAuth2
  65. 第 65 篇 SpringBoot 官方文档翻译 65 — SAML 2.0
  66. 第 66 篇 SpringBoot 官方文档翻译 66 — 测试 (Testing)
  67. 第 67 篇 SpringBoot 官方文档翻译 67 — 测试模块 (Test Modules)
  68. 第 68 篇 SpringBoot 官方文档翻译 68 — 测试作用域依赖
  69. 第 69 篇 SpringBoot 官方文档翻译 69 — 测试 Spring 应用
  70. 第 70 篇 SpringBoot 官方文档翻译 70 — 测试 Spring Boot 应用
  71. 第 71 篇 SpringBoot 官方文档翻译 71 — Testcontainers
  72. 第 72 篇 SpringBoot 官方文档翻译 72 — 测试实用工具 (Test Utilities)
  73. 第 73 篇 SpringBoot 官方文档翻译 73 — 打包 Spring Boot 应用
  74. 第 74 篇 SpringBoot 官方文档翻译 74 — 高效部署
  75. 第 75 篇 SpringBoot 官方文档翻译 75 — AOT 缓存
  76. 第 76 篇 SpringBoot 官方文档翻译 76 — JVM 提前处理
  77. 第 77 篇 SpringBoot 官方文档翻译 77 — GraalVM 原生镜像
  78. 第 78 篇 SpringBoot 官方文档翻译 78 — 介绍 GraalVM 原生镜像
  79. 第 79 篇 SpringBoot 官方文档翻译 79 — 高级原生镜像主题
  80. 第 80 篇 SpringBoot 官方文档翻译 80 — JVM 检查点与恢复
  81. 第 81 篇 SpringBoot 官方文档翻译 81 — 容器镜像
  82. 第 82 篇 SpringBoot 官方文档翻译 82 — 高效容器镜像
  83. 第 83 篇 SpringBoot 官方文档翻译 83 — Dockerfile
  84. 第 84 篇 SpringBoot 官方文档翻译 84 — Cloud Native Buildpacks
  85. 第 85 篇 SpringBoot 官方文档翻译 85 — 生产就绪特性
  86. 第 86 篇 SpringBoot 官方文档翻译 86 — 启用生产就绪特性
  87. 第 87 篇 SpringBoot 官方文档翻译 87 — 端点 (Endpoints)
  88. 第 88 篇 SpringBoot 官方文档翻译 88 — 通过 HTTP 监控与管理
  89. 第 89 篇 SpringBoot 官方文档翻译 89 — 通过 JMX 监控与管理
  90. 第 90 篇 SpringBoot 官方文档翻译 90 — 可观测性 (Observability)
  91. 第 91 篇 SpringBoot 官方文档翻译 91 — 日志(Actuator)
  92. 第 92 篇 SpringBoot 官方文档翻译 92 — 指标 (Metrics)
  93. 第 93 篇 SpringBoot 官方文档翻译 93 — 追踪 (Tracing)
  94. 第 94 篇 SpringBoot 官方文档翻译 94 — 审计
  95. 第 95 篇 SpringBoot 官方文档翻译 95 — 记录 HTTP 交换
  96. 第 96 篇 SpringBoot 官方文档翻译 96 — 进程监控
  97. 第 97 篇 SpringBoot 官方文档翻译 97 — Cloud Foundry 支持
  98. 第 98 篇 SpringBoot 官方文档翻译 98 — How-to 指南
  99. 第 99 篇 SpringBoot 官方文档翻译 99 — Spring Boot 应用
  100. 第 100 篇 SpringBoot 官方文档翻译 100 — 属性与配置
  101. 第 101 篇 SpringBoot 官方文档翻译 101 — 嵌入式 Web 服务器
  102. 第 102 篇 SpringBoot 官方文档翻译 102 — Spring MVC
  103. 第 103 篇 SpringBoot 官方文档翻译 103 — Jersey
  104. 第 104 篇 SpringBoot 官方文档翻译 104 — HTTP 客户端
  105. 第 105 篇 SpringBoot 官方文档翻译 105 — 日志
  106. 第 106 篇 SpringBoot 官方文档翻译 106 — 数据访问
  107. 第 107 篇 SpringBoot 官方文档翻译 107 — 数据库初始化
  108. 第 108 篇 SpringBoot 官方文档翻译 108 — NoSQL
  109. 第 109 篇 SpringBoot 官方文档翻译 109 — 消息
  110. 第 110 篇 SpringBoot 官方文档翻译 110 — 批处理应用
  111. 第 111 篇 SpringBoot 官方文档翻译 111 — Actuator
  112. 第 112 篇 SpringBoot 官方文档翻译 112 — 安全
  113. 第 113 篇 SpringBoot 官方文档翻译 113 — 热交换
  114. 第 114 篇 SpringBoot 官方文档翻译 114 — 测试
  115. 第 115 篇 SpringBoot 官方文档翻译 115 — 构建
  116. 第 116 篇 SpringBoot 官方文档翻译 116 — 提前处理
  117. 第 117 篇 SpringBoot 官方文档翻译 117 — GraalVM 原生应用
  118. 第 118 篇 SpringBoot 官方文档翻译 118 — 开发第一个 GraalVM 原生应用
  119. 第 119 篇 SpringBoot 官方文档翻译 119 — 测试 GraalVM 原生镜像
  120. 第 120 篇 SpringBoot 官方文档翻译 120 — AOT 缓存
  121. 第 121 篇 SpringBoot 官方文档翻译 121 — 部署 Spring Boot 应用
  122. 第 122 篇 SpringBoot 官方文档翻译 122 — 传统部署
  123. 第 123 篇 SpringBoot 官方文档翻译 123 — 部署到云
  124. 第 124 篇 SpringBoot 官方文档翻译 124 — 安装 Spring Boot 应用
  125. 第 125 篇 SpringBoot 官方文档翻译 125 — Docker Compose
  126. 第 126 篇 SpringBoot 官方文档翻译 126 — 构建工具插件
  127. 第 127 篇 SpringBoot 官方文档翻译 127 — Maven 插件
  128. 第 128 篇 SpringBoot 官方文档翻译 128 — Maven 插件入门
  129. 第 129 篇 SpringBoot 官方文档翻译 129 — 使用 Maven 插件
  130. 第 130 篇 SpringBoot 官方文档翻译 130 — Maven 插件目标
  131. 第 131 篇 SpringBoot 官方文档翻译 131 — Maven 打包可执行归档
  132. 第 132 篇 SpringBoot 官方文档翻译 132 — Maven 打包 OCI 镜像
  133. 第 133 篇 SpringBoot 官方文档翻译 133 — 使用 Maven 运行应用
  134. 第 134 篇 SpringBoot 官方文档翻译 134 — Maven 提前处理
  135. 第 135 篇 SpringBoot 官方文档翻译 135 — Maven 运行集成测试
  136. 第 136 篇 SpringBoot 官方文档翻译 136 — Maven 与 Actuator 集成
  137. 第 137 篇 SpringBoot 官方文档翻译 137 — Maven 帮助信息
  138. 第 138 篇 SpringBoot 官方文档翻译 138 — Gradle 插件
  139. 第 139 篇 SpringBoot 官方文档翻译 139 — Gradle 插件入门
  140. 第 140 篇 SpringBoot 官方文档翻译 140 — Gradle 依赖管理
  141. 第 141 篇 SpringBoot 官方文档翻译 141 — Gradle 打包可执行归档
  142. 第 142 篇 SpringBoot 官方文档翻译 142 — Gradle 打包 OCI 镜像
  143. 第 143 篇 SpringBoot 官方文档翻译 143 — Gradle 发布应用
  144. 第 144 篇 SpringBoot 官方文档翻译 144 — 使用 Gradle 运行应用
  145. 第 145 篇 SpringBoot 官方文档翻译 145 — Gradle 提前处理
  146. 第 146 篇 SpringBoot 官方文档翻译 146 — Gradle 与 Actuator 集成
  147. 第 147 篇 SpringBoot 官方文档翻译 147 — Gradle 对其他插件的反应
  148. 第 148 篇 SpringBoot 官方文档翻译 148 — Spring Boot AntLib 模块
  149. 第 149 篇 SpringBoot 官方文档翻译 149 — 支持其他构建系统
  150. 第 150 篇 SpringBoot 官方文档翻译 150 — Spring Boot CLI
  151. 第 151 篇 SpringBoot 官方文档翻译 151 — 安装 CLI
  152. 第 152 篇 SpringBoot 官方文档翻译 152 — 使用 CLI
  153. 第 153 篇 SpringBoot 官方文档翻译 153 — Actuator REST API
  154. 第 154 篇 SpringBoot 官方文档翻译 154 — Actuator API: 审计事件 (auditevents)
  155. 第 155 篇 SpringBoot 官方文档翻译 155 — Actuator API: Bean (beans)
  156. 第 156 篇 SpringBoot 官方文档翻译 156 — Actuator API: 缓存 (caches)
  157. 第 157 篇 SpringBoot 官方文档翻译 157 — Actuator API: 条件评估报表 (conditions)
  158. 第 158 篇 SpringBoot 官方文档翻译 158 — Actuator API: 配置属性 (configprops)
  159. 第 159 篇 SpringBoot 官方文档翻译 159 — Actuator API: 环境 (env)
  160. 第 160 篇 SpringBoot 官方文档翻译 160 — Actuator API: Flyway (flyway)
  161. 第 161 篇 SpringBoot 官方文档翻译 161 — Actuator API: 健康 (health)
  162. 第 162 篇 SpringBoot 官方文档翻译 162 — Actuator API: 堆转储 (heapdump)
  163. 第 163 篇 SpringBoot 官方文档翻译 163 — Actuator API: HTTP 交换 (httpexchanges)
  164. 第 164 篇 SpringBoot 官方文档翻译 164 — Actuator API: 应用信息 (info)
  165. 第 165 篇 SpringBoot 官方文档翻译 165 — Actuator API: Spring Integration 图 (integrationgraph)
  166. 第 166 篇 SpringBoot 官方文档翻译 166 — Actuator API: Liquibase (liquibase)
  167. 第 167 篇 SpringBoot 官方文档翻译 167 — Actuator API: 日志文件 (logfile)
  168. 第 168 篇 SpringBoot 官方文档翻译 168 — Actuator API: Loggers (loggers)
  169. 第 169 篇 SpringBoot 官方文档翻译 169 — Actuator API: 映射 (mappings)
  170. 第 170 篇 SpringBoot 官方文档翻译 170 — Actuator API: 指标 (metrics)
  171. 第 171 篇 SpringBoot 官方文档翻译 171 — Actuator API: Prometheus (prometheus)
  172. 第 172 篇 SpringBoot 官方文档翻译 172 — Actuator API: Quartz (quartz)
  173. 第 173 篇 SpringBoot 官方文档翻译 173 — Actuator API: 软件物料清单 (sbom)
  174. 第 174 篇 SpringBoot 官方文档翻译 174 — Actuator API: 计划任务 (scheduledtasks)
  175. 第 175 篇 SpringBoot 官方文档翻译 175 — Actuator API: 会话 (sessions)
  176. 第 176 篇 SpringBoot 官方文档翻译 176 — Actuator API: 关闭 (shutdown)
  177. 第 177 篇 SpringBoot 官方文档翻译 177 — Actuator API: 应用启动 (startup)
  178. 第 178 篇 SpringBoot 官方文档翻译 178 — Actuator API: 线程转储 (threaddump)
  179. 第 179 篇 SpringBoot 官方文档翻译 179 — Spring Boot Java API
  180. 第 180 篇 SpringBoot 官方文档翻译 180 — Gradle Plugin Java API
  181. 第 181 篇 SpringBoot 官方文档翻译 181 — Maven Plugin Java API
  182. 第 182 篇 SpringBoot 官方文档翻译 182 — Spring Boot Kotlin API
  183. 第 183 篇 SpringBoot 官方文档翻译 183 — 配置元数据
  184. 第 184 篇 SpringBoot 官方文档翻译 184 — 元数据格式
  185. 第 185 篇 SpringBoot 官方文档翻译 185 — 提供手动提示
  186. 第 186 篇 SpringBoot 官方文档翻译 186 — 使用注解处理器生成元数据
  187. 第 187 篇 SpringBoot 官方文档翻译 187 — 可执行 Jar 格式
  188. 第 188 篇 SpringBoot 官方文档翻译 188 — 嵌套 JAR
  189. 第 189 篇 SpringBoot 官方文档翻译 189 — NestedJarFile 类
  190. 第 190 篇 SpringBoot 官方文档翻译 190 — 启动可执行 Jar
  191. 第 191 篇 SpringBoot 官方文档翻译 191 — PropertiesLauncher 特性
  192. 第 192 篇 SpringBoot 官方文档翻译 192 — 可执行 Jar 限制
  193. 第 193 篇 SpringBoot 官方文档翻译 193 — 替代的单一 Jar 方案
  194. 第 194 篇 SpringBoot 官方文档翻译 194 — 常见应用属性
  195. 第 195 篇 SpringBoot 官方文档翻译 195 — 已弃用的应用属性
  196. 第 196 篇 SpringBoot 官方文档翻译 196 — 自动配置类
  197. 第 197 篇 SpringBoot 官方文档翻译 197 — 测试自动配置注解
  198. 第 198 篇 SpringBoot 官方文档翻译 198 — 测试切片
  199. 第 199 篇 SpringBoot 官方文档翻译 199 — 依赖版本
  200. 第 200 篇 SpringBoot 官方文档翻译 200 — 管理的依赖坐标
  201. 第 201 篇 SpringBoot 官方文档翻译 201 — 版本属性
  202. 第 202 篇 SpringBoot 官方文档翻译 202 — 自动配置类: spring-boot-activemq
  203. 第 203 篇 SpringBoot 官方文档翻译 203 — 自动配置类: spring-boot-actuator-autoconfigure
  204. 第 204 篇 SpringBoot 官方文档翻译 204 — 自动配置类: spring-boot-amqp
  205. 第 205 篇 SpringBoot 官方文档翻译 205 — 自动配置类: spring-boot-amqp-rabbitmq
  206. 第 206 篇 SpringBoot 官方文档翻译 206 — 自动配置类: spring-boot-artemis
  207. 第 207 篇 SpringBoot 官方文档翻译 207 — 自动配置类: spring-boot-autoconfigure
  208. 第 208 篇 SpringBoot 官方文档翻译 208 — 自动配置类: spring-boot-batch
  209. 第 209 篇 SpringBoot 官方文档翻译 209 — 自动配置类: spring-boot-batch-data-mongodb
  210. 第 210 篇 SpringBoot 官方文档翻译 210 — 自动配置类: spring-boot-batch-jdbc
  211. 第 211 篇 SpringBoot 官方文档翻译 211 — 自动配置类: spring-boot-cache

RESPONSES / LOG

读者来信 / RESPONSES

发表评论

评论需审核后展示。

暂无评论