想检查 Spring boot 是否提供帮助以使用 application.properties
文件之外的配置文件。例如:my-custom.properties 文件可以是特定于配置文件的,
例如:
my-custom-dev.properties
dev 配置文件my-custom-uat.properties
uat 个人资料
编辑:问题是,我有正常的 application-{env}.property 文件,除此之外,还有其他符合其数据内容的属性文件(例如:我想要的用于日志记录的 DB 特定属性存储在 `db-log.properties 中,我如何使其他文件配置敏感?
最佳答案
您可以将其与 Activity 配置文件一起使用
@Configuration
@PropertySource("classpath:my-custom-${spring.profiles.active}.properties")
关于java - 在 Spring boot 中分析特定的自定义属性文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54519428/