配置优先级
配置加载顺序:
Spring Boot 在加载配置文件时,优先级从高到低依次为:
命令行参数
系统属性
特定 profile 的配置文件(例如 application-prd.yml)
默认配置文件(application.yml 或 application.properties)
通过 spring.profiles.include 引入的配置文件
优先级高的配置会覆盖优先级低的配置。
Last updated
Was this helpful?
Spring Boot 在加载配置文件时,优先级从高到低依次为:
命令行参数
系统属性
特定 profile 的配置文件(例如 application-prd.yml)
默认配置文件(application.yml 或 application.properties)
通过 spring.profiles.include 引入的配置文件
优先级高的配置会覆盖优先级低的配置。
Last updated
Was this helpful?