Feature Article

SpringBoot 官方文档翻译 22 — 外部化配置 (Externalized Configuration)

Spring Boot 官方文档翻译系列:属性源顺序、配置文件、YAML、类型安全配置属性与转换。

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

外部化配置

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

Spring Boot 允许你将配置外部化,以便在不同环境中使用相同的应用代码。可以使用多种外部配置源,包括 Java 属性文件、YAML 文件、环境变量和命令行参数。

属性值可以通过 @Value 注解直接注入 bean,通过 Spring 的 Environment 抽象访问,或者通过 @ConfigurationProperties 绑定到结构化对象。

Spring Boot 使用特定的 PropertySource 顺序,以支持合理的覆盖。后面的属性源可以覆盖前面定义的值。属性源按以下顺序考虑:

  1. 默认属性(通过 SpringApplication.setDefaultProperties(Map) 指定)。
  2. @Configuration 类上的 @PropertySource 注解。注意,这类属性源直到应用上下文刷新时才添加到 Environment,对于在刷新前读取的 logging.* 和 spring.main.* 等属性来说太晚。
  3. Config data(如 application.properties 文件)。
  4. RandomValuePropertySource(仅含 random.* 属性)。
  5. 操作系统环境变量。
  6. Java 系统属性(System.getProperties())。
  7. 来自 java:comp/env 的 JNDI 属性。
  8. ServletContext 初始化参数。
  9. ServletConfig 初始化参数。
  10. SPRING_APPLICATION_JSON 中的属性(嵌入在环境变量或系统属性中的内联 JSON)。
  11. 命令行参数。
  12. 测试中的 properties 属性(可用于 @SpringBootTest 及测试切片的注解)。
  13. 测试中的 @DynamicPropertySource 注解。
  14. 测试中的 @TestPropertySource 注解。
  15. devtools 处于活动状态时 $HOME/.config/spring-boot 目录中的全局设置属性。

配置文件按以下顺序考虑:jar 内部的应用属性、jar 内部的特定 profile 属性、jar 外部的应用属性、jar 外部的特定 profile 属性。

建议整个应用坚持使用一种格式。如果同一位置同时存在 .properties 和 YAML 格式的配置文件,.properties 优先。

如果使用环境变量,大多数操作系统不允许点分隔的 key 名,可以使用下划线代替(例如 SPRING_CONFIG_NAME 代替 spring.config.name)。

如果应用在 Servlet 容器或应用服务器中运行,可以使用 JNDI 属性(java:comp/env)或 Servlet 上下文初始化参数代替或补充环境变量与系统属性。

env 和 configprops 端点有助于确定某个属性为何具有特定值,可用于诊断意外的属性值,详见生产就绪特性。

访问命令行属性

默认情况下,SpringApplication 将任何以 -- 开头的命令行选项参数(如 --server.port=9000)转换为属性并添加到 Spring Environment。命令行属性始终优先于基于文件的属性源。如果不希望添加命令行属性,可以使用 SpringApplication.setAddCommandLineProperties(false) 禁用。

JSON 应用属性

环境变量和系统属性通常有限制,导致某些属性名无法使用。为此,Spring Boot 允许将一组属性编码为单个 JSON 结构。应用启动时,任何 spring.application.json 或 SPRING_APPLICATION_JSON 属性都会被解析并添加到 Environment。

$ SPRING_APPLICATION_JSON='{"my":{"name":"test"}}' java -jar myapp.jar
$ java -Dspring.application.json='{"my":{"name":"test"}}' -jar myapp.jar
$ java -jar myapp.jar --spring.application.json='{"my":{"name":"test"}}'

如果部署到传统应用服务器,还可以使用名为 java:comp/env/spring.application.json 的 JNDI 变量。

尽管 JSON 中的 null 值会被添加到结果属性源,但 PropertySourcesPropertyResolver 将 null 属性视为缺失值。因此 JSON 无法用 null 覆盖更低优先级属性源中的属性。

外部应用属性

Spring Boot 启动时会自动从以下位置查找并加载 application.properties 和 application.yaml 文件:classpath 根目录、classpath 的 /config 包、当前目录、当前目录的 config/ 子目录、config/ 子目录的直接子目录。列表按优先级排序,后面位置的值覆盖前面的。

如果不喜欢 application 作为配置文件名,可以通过 spring.config.name 环境属性切换:

$ java -jar myproject.jar --spring.config.name=myproject

也可以使用 spring.config.location 属性指定显式位置,该属性接受以逗号分隔的一个或多个位置列表:

$ java -jar myproject.jar --spring.config.location=optional:classpath:/default.properties,optional:classpath:/override.properties

如果位置是可选的且不介意其不存在,请使用 optional: 前缀。

spring.config.name、spring.config.location 和 spring.config.additional-location 在非常早期就被用于确定要加载哪些文件,必须定义为环境属性(通常是 OS 环境变量、系统属性或命令行参数)。

如果 spring.config.location 包含目录(而非文件),它们应以 / 结尾。目录和文件位置值都会扩展以检查特定 profile 文件。

可选位置

optional: 前缀表示位置是可选的;如果位置不存在,不会报错。

通配符位置

Spring Boot 支持在 spring.config.location 中使用通配符 * 加载多个配置文件,例如 classpath:/config/*/application.properties。通配符位置在配置中心与多租户场景中很有用。注意,通配符位置按字母顺序处理,后面的配置会覆盖前面的。

特定 Profile 文件

除了 application.properties,Spring Boot 还会尝试加载 application-{profile}.properties(及 YAML 变体)。如果活动 profile 未被设置,默认 profile(default)的文件也会被加载。特定 profile 文件的优先级始终高于非特定文件,无论其位置如何。

导入额外数据

可以使用 spring.config.import 属性从其他位置导入配置数据,例如:

spring.config.import=optional:file:./dev.properties

导入按声明顺序处理,后导入的优先。spring.config.import 支持 classpath、file、URL 以及 configtree: 等位置。

导入无扩展名文件

某些平台要求配置文件没有文件扩展名。设置 spring.config.name 时,可以配合 spring.config.location 指定无扩展名文件。

文件属性

spring.config.location 支持 optional: 前缀、classpath:、file: 等前缀,以及 URL。多个位置用逗号分隔。

使用环境变量

Spring Boot 会将环境变量名转换为属性名:将点替换为下划线、移除连字符、转为大写。例如 spring.main.log-startup-info 对应 SPRING_MAIN_LOGSTARTUPINFO。环境变量通常优先于属性文件。

使用配置树

在 Kubernetes 等平台中,Secrets 和 ConfigMaps 常以目录树形式挂载。可以使用 configtree: 前缀导入,例如 spring.config.import=configtree:/etc/config/。目录结构会映射为属性名:文件名成为属性名,文件内容成为属性值。

属性占位符

配置文件中的值可以使用 ${name} 占位符引用其他属性,例如 name=MyApp 和 description=${name} is great。占位符支持默认值 ${name:default} 和嵌套。

使用多文档文件

Spring Boot 支持在一个 YAML 或 Properties 文件中使用多个文档,用 ---(YAML)或 #---(Properties)分隔。每个文档可以独立激活,例如通过 spring.config.activate.on-profile。

激活属性

spring.config.activate.on-profile 和 spring.config.activate.on-cloud-platform 可用于按条件激活文档。这些属性只能用于非 profile 特定的文档。

加密属性

Spring Boot 不提供内置的加密属性支持,但可以通过自定义 EnvironmentPostProcessor 或集成外部秘密管理工具实现。

使用 YAML

YAML 是 JSON 的超集,适合分层配置数据。Spring Boot 支持 YAML 文件作为属性源,只要 SnakeYAML 在 classpath 上(starter 默认包含)。YAML 文件可用 application.yaml 或 application.yml 命名。

将 YAML 映射到属性

YAML 的层级结构会被展平为点分隔的属性名,例如:

spring:
  main:
    log-startup-info: false

等价于 spring.main.log-startup-info=false。列表会映射为 [0]、[1] 等索引形式。

直接加载 YAML

可以使用 YamlPropertiesFactoryBean 或 YamlMapFactoryBean 直接加载 YAML 内容。

配置随机值

RandomValuePropertySource 对 random.* 属性可用,可生成随机 int、long、uuid 或字符串,例如 my.secret=${random.value}、my.number=${random.int}、my.uuid=${random.uuid}。

配置系统环境属性

可以通过 System.setProperty() 或操作系统环境变量设置系统属性。Spring Boot 对系统属性的处理遵循标准的属性源优先级。

类型安全的配置属性

@ConfigurationProperties 提供类型安全的结构化配置绑定。它通常与 @Component 结合使用,或通过 @EnableConfigurationProperties 启用。

JavaBean 属性绑定

标准的 JavaBean 属性(带 getter/setter)可以绑定到配置属性。属性名支持 kebab-case 等宽松绑定形式。

构造器绑定

当类具有单个带参构造器时,Spring Boot 使用该构造器进行绑定,支持不可变对象。这是推荐的方式,尤其适合 Kotlin 数据类与 Java record。

默认值

可以在 JavaBean 属性的 setter 或构造器参数中提供默认值,或使用字段初始化器。

启用 @ConfigurationProperties 注解类型

可以通过在 @Configuration 类上使用 @EnableConfigurationProperties 显式注册 @ConfigurationProperties bean,也可通过组件扫描自动注册。Spring Boot 还会扫描 META-INF/spring-configuration-metadata.json 等元数据以生成 IDE 提示。

使用 @ConfigurationProperties 注解类型

注入配置属性 bean 后,可以像普通 bean 一样使用。属性变更不会触发 bean 刷新,除非使用刷新作用域。

第三方配置

@ConfigurationProperties 也可以用于第三方类,通过 @EnableConfigurationProperties 注册。

宽松绑定

Spring Boot 使用宽松绑定规则,允许属性名使用 kebab-case、camelCase、snake_case 以及大写形式,并支持环境变量映射(点转下划线、移除连字符、大写)。

合并复杂类型

当多个属性源定义了 List、Map 等复杂类型时,后面的属性源会覆盖前面的整个值,而不是逐元素合并。可以通过索引或 key 精确覆盖。

属性转换

Spring Boot 内置了常见类型的转换器,包括 Duration、DataSize、Period、字符数组、InetAddress、枚举等。Duration 支持 10s、5m、1h 等格式;DataSize 支持 10MB、1GB 等格式。可以通过实现 Converter 或添加 ConversionService 自定义转换。

@ConfigurationProperties 校验

可以使用 JSR-303 校验注解(如 @NotNull、@Min)对配置属性进行校验,需提供相应的校验实现(如 Hibernate Validator)。校验会在绑定后自动执行。

@ConfigurationProperties 与 @Value 的对比

@Value 是注入单个属性的简单方式,不支持宽松绑定和结构化绑定,也不支持元数据生成。对于结构化、类型安全的配置,推荐使用 @ConfigurationProperties。如果只想注入单个值,@Value 更便捷。

核心特性 日志

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

发表评论

评论需审核后展示。

暂无评论