Ensure direct @PropertySource
annotations override meta-annotations
#31074
Labels
in: core
Issues in core modules (aop, beans, core, context, expression)
type: enhancement
A general enhancement
Milestone
Overview
Although the work performed in conjunction with #30941 ensures that all
@PropertySource
annotations are found, we still have an issue with the semantics of property source overrides.Ideally, a
@PropertySource
declared closer to (or directly on) an@Configuration
class should override any@PropertySource
annotation present as a meta-annotation on the@Configuration
class.Note that the search algorithm for
@TestPropertySource
already supports those semantics.Example
With the status quo, the following test fails, because
P1
is registered with higher precedence thanP2
.Deliverables
@PropertySource
annotations override meta-annotations.The text was updated successfully, but these errors were encountered: