多环境

时间:2021-08-22 14:32:43   收藏:0   阅读:12

每一种环境写一种, 必须以 application- 开头.
application-dev.properties
application-int.properties
application-test.properties
application-pro.properties

可以在不同得文件中设置不同得端口,不同得上下文根
context-path=/dev
context-path=/int
context-path=/test
context-path=/pro

在 application.properties 中设置激活哪个配置文件
spring.profiles.active=dev

或者在程序运行时, 如果使用命令行的话:

技术分享图片

 

原文:https://www.cnblogs.com/moveofgod/p/15171293.html

评论(0)
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!