1. Home
  2. Docs
  3. java
  4. spring boot
  5. 配置

配置

yml

  • application.yml
  • application-dev.yml
  • application-pro.yml

application.yml

spring:
  profiles:
    active: dev #改变这个字符加载不同的配置文件

properties

  • application.properties
  • application-dev.properties
  • application-pro.properties

application.properties

spring.profiles.active=dev  #改变这个字符加载不同的配置文件

相关资源

分布式配置中心-apollo(阿波罗)

相关资料

Spring Boot通过配置文件区分测试和生产环境
SpringBoot不同环境(生产/开发/测试/本地)读取不同Properties配置文件

Was this article helpful to you? Yes No

How can we help?