【发布时间】:2018-03-09 07:29:06
【问题描述】:
我想知道是否有一种方法可以在 spring 应用程序中动态引用多个 application-*.properties 文件中的键。我面临的挑战是每个应用程序的属性文件名可能不同。我尝试了 spring.config.location、spring.config.name 的各种组合,使用了 ClassPathResource 但没有运气
例如在 src/main/resources 中,我可能拥有应用程序 A application.properties、application-system-X.properties、application-system-Y.properties
例如在 src/main/resources 我可能有应用程序 B、application.properties、application-system-P.properties、application-system-Q.properties
【问题讨论】:
标签: spring