Files
roll-room/doc/开发标准/多环境配置文件.md
2026-04-23 16:58:11 +08:00

13 lines
652 B
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

application.yml 是项目的通用配置文件
application-{profile}.yml 是项目不同环境的配置文件如果与application.yml配置内容重复则以application-{profile}.yml配置为准
当前有三个环境的配置文件:
- application-dev.yml 开发环境配置。本地测试用
- application-test.yml 测试环境配置。服务器上测试环境用
- application-pro.yml 生产环境配置
application.yml中默认启用的是application-dev.yml。可以通过环境变量进行修改。
在IDEA中编辑启动配置添加环境变量`SPRING_PROFILES_ACTIVE=test`, 即可启用application-test.yml配置。以此类推