[spring-boot] 多环境配置

  application-{profile}.properties 

  

按照格式创建两个配置文件,一个DEV环境,一个测试环境

修改其端口:

server.port=8888  DEV   
server.port=9999  TEST

然后程序进行打包

打开CMD 执行
java -jar xxx.jar --spring.profiles.active=dev 
java -jar xxx.jar --spring.profiles.active=test

 

posted @ 2019-06-12 16:17  菠萝小妹。  阅读(209)  评论(0编辑  收藏  举报