spring 云配置 属性 文件顺序问题
Issue with spring cloud config property file order
我正在使用 spring 云配置来为我的应用程序加载属性文件。我有多个环境。我注意到 属性 文件加载顺序错误。这是我在日志中看到的
Located property source: CompositePropertySource [name='configService', propertySources=[MapPropertySource [name='https://github.com/xyz/configrepo.git/gatekeeper-dev.properties'], MapPropertySource [name='https://github.com/xyz/configrepo.git/gatekeeper.properties']]]
似乎首先加载了特定于环境的 属性 文件并被默认的 属性 文件覆盖。有什么办法可以控制它们的加载和处理顺序吗?
这是预期的顺序(出于充分的理由,我很惊讶你发现了一个不方便的用例)。除了更改文件名并以逗号分隔的形式列出它们之外,您无法控制它。为清楚起见:配置文件特定属性始终覆盖默认属性。可能日志让您感到困惑。
我正在使用 spring 云配置来为我的应用程序加载属性文件。我有多个环境。我注意到 属性 文件加载顺序错误。这是我在日志中看到的
Located property source: CompositePropertySource [name='configService', propertySources=[MapPropertySource [name='https://github.com/xyz/configrepo.git/gatekeeper-dev.properties'], MapPropertySource [name='https://github.com/xyz/configrepo.git/gatekeeper.properties']]]
似乎首先加载了特定于环境的 属性 文件并被默认的 属性 文件覆盖。有什么办法可以控制它们的加载和处理顺序吗?
这是预期的顺序(出于充分的理由,我很惊讶你发现了一个不方便的用例)。除了更改文件名并以逗号分隔的形式列出它们之外,您无法控制它。为清楚起见:配置文件特定属性始终覆盖默认属性。可能日志让您感到困惑。