SpringBoot使用yml配置多 profile

profile是Spring对不同环境提供不同配置功能的支持,可以通过**、指定参数的方式来快速切换环境。
第一种方式
yml多文档块方式
SpringBoot使用yml配置多 profile
第二种方式
SpringBoot使用yml配置多 profile
第三中方式
先将项目打包,然后运行命令。

java -jar spring-boot-hello-quick-0.0.1-SNAPSHOT.jar --spring.profiles.active=prod

SpringBoot使用yml配置多 profile
第四种方式
SpringBoot使用yml配置多 profile