使用spring.profiles.active来分区配置,比如dev、test、prod等环境
(1)
在application.properties中加入
spring.profiles.active=dev
(2)
通过命令行参数
java -jar app.jar --spring.profiles.active=dev