application.yml
# 激活某个环境配置
spring:
profiles:
active: dev
# 通用配置
server:
servlet:
context-path: /aaa
application-dev.yml
server:
port: 8081
application-test.yml
server:
port: 8082
servlet:
context-path: /bbb
application-prod.yml
server:
port: 8083
本文介绍了如何在SpringBoot应用中使用`application.yml`配置文件管理不同环境(如dev、test、prod)的服务器端口和上下文路径,展示了`spring.profiles.active`的使用方法。


被折叠的 条评论
为什么被折叠?



