[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

猜你喜欢

转载自www.cnblogs.com/anny0404/p/11010358.html