Spring Boot实践记录

SpringBoot配置多套环境

2017-02-08  本文已影响237人  Chinesszz

生产中会经历,开发,测试,到上线。三个阶段

 这个三个阶段,都有各自的配置文件,如果只是一个配置文件来回改
 会很容易出现错误的,那么springboot提供了很简答的解决办法

使用spring.profiles.active=test

使用java -jar mm.jar --spring.profiles.active=dev 运行启动dev环境

可以看到启动的是dev

2017-01-04 18:54:11.095  INFO 43026 --- [  restartedMain] dragonfly.DragonflyApplication           : Starting DragonflyApplication on KK-MINI.local with PID 43026 (/Users/liuxin/git/oto_saas_mybosc_pay/target/classes started by liuxin in /Users/liuxin/git/oto_saas_mybosc_pay)
2017-01-04 18:54:11.100  INFO 43026 --- [  restartedMain] dragonfly.DragonflyApplication           : The following profiles are active: dev
上一篇 下一篇

猜你喜欢

热点阅读