springboot的profile配置

  Profile是Spring用来针对不同的环境对不同的配置提供支持的,全局Profile配置使用application-{profile}.properties

  通过在application,properties中设置spring.profies.active=***来指定活动的profile

  简单演示,生产环境的端口为80,开发环境的端口为8888.

  配置文件如下:

  appilcation-prod.properties:

      appilcation-dev.properties:

  目录结构:

 

 appilcation.properties增加:

运行结果:

 

posted @ 2017-08-22 20:21  崔布斯  阅读(432)  评论(0编辑  收藏  举报