SpringBoot多环境配置
可以从以下位置加载配置文件,优先级由高到低
Config locations are searched in reverse order. By default, the configured locations are classpath:/,classpath:/config/,file:./,file:./config/*/,file:./config/
. The resulting search order is the following:
file:./config/
file:./config/*/
file:./
classpath:/config/
classpath:/
application.yml
#springboot多环境配置:可以选择激活哪一个配置文件
spring:
profiles:
active: dev # 选择application-dev.yml环境
application-dev.yml
server:
port: 8081 #配置端口号
application-test.yml
server:
port: 8082 #配置端口号