【发布时间】:2023-02-06 14:30:45
【问题描述】:
我想根据环境创建 3 个配置文件来访问数据库
而不是将所有属性写在一个文件中。我希望属性必须根据环境(Qlty、Prod、Dev)分成 3 个。那是
1.application_prod.properties --should contain all production related details
2.application_qlty.properties --should contain all qlty related details
3.application_dev.properties --should contain all dev related details
如何在spring boot中实现以上3个profile,以及如何根据环境类型选择profile。以简单的方式实施上述内容的最佳做法是什么
【问题讨论】:
-
你打算怎么运行它?
-
那是一个maven项目吗?