spring boot 多环境(dev、test、prod)配置文件---命令行切换
时间:2019-10-02 23:09:23
收藏:0
阅读:133
- properties配置格式
在Spring boot 中多环境配置文件名需要满足application-{profile}.properties的格式,其中{profile}对于你的环境标识,比如:
在application.properties 中配置 spring.profiles.active=dev #默认开发环境
在启动jar包时,使用命令行切换
-
java -jar xxx.jar --spring.profiles.active=test // 测试环境配置文件 java -jar xxx.jar --spring.profiles.active=prod// 生产环境配置文件
原文:https://www.cnblogs.com/shar-wang/p/11618658.html
评论(0)