application.properties 多环境配置 二

该设置适用于:application.properties 文件

通过创建多个.properties/.yml文件

application.properties 多环境配置 二
按照 application-{value}.properties 格式 即可实现不同环境的切换
在idea中 切换环境设置:
application.properties 多环境配置 二
或者:
application.properties 多环境配置 二
在linux 环境中切换环境:
java -jar xxxxx.jar --spring.profiles.active=test 表示加载测试环境的配置
java -jar xxxxx.jar --spring.profiles.active=pre 表示加载生产环境的配置