SpringBoot(SpringMVC二(多环境配置))

今后我们在开发过程中有很多种开发环境那么可能就有很多个环境的配置文件。那么如何进行配置呢?
在这里插入图片描述
application-dev.properties文件下:

server. port=8089
server. context-path: / springboot - dev

注意:这里springboot默认加载application.properties文件,需要在默认文件中把其他的配置文件进行激活

application.properties文件下:

spring. profiles. active=dev

测试:
在这里插入图片描述
注意细节:
在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/Denial_learn/article/details/103470231