每一种环境写一种, 必须以 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

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

多环境

 

相关文章:

  • 2021-10-25
  • 2021-05-22
  • 2021-07-01
  • 2021-10-31
  • 2021-08-03
  • 2021-08-06
  • 2021-08-20
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-11
  • 2022-12-23
相关资源
相似解决方案