我正试图为我的应用程序配置提供两个外部文件,一个文件具有所有应用程序的公共属性,另一个文件包含每个应用程序的特定内容。
在我的Springboot应用程序中,我声明:
@PropertySource(value = {"file:/etc/company/application.properties",
"file:/etc/company/myApp/application.properties"}, ignoreResourceNotFound = true)在原木里,
Converting PropertySource applicationConfig: [classpath:/application.properties] [org.springframework.boot.env.OriginTrackedMapPropertySource] to EncryptableMapPropertySourceWrapper
Converting PropertySource URL [file:/etc/company/myApp/application.properties] [org.springframework.core.io.support.ResourcePropertySource] to EncryptableMapPropertySourceWrapper
Converting PropertySource URL [file:/etc/company/application.properties] [org.springframework.core.io.support.ResourcePropertySource] to EncryptableMapPropertySourceWrapper/etc/company/application.properties的属性是考虑到的。这与PropertySource javadoc中提到的内容完全相反。
我是不是漏掉了什么?
发布于 2020-05-26 13:52:36
经过大量的研究发现,Spring和Spring似乎都没有保证属性源加载的顺序。我确实删除了我的属性继承:一个应用程序,一个app.properties文件。
https://stackoverflow.com/questions/61822827
复制相似问题