Closed
Description
Overview
As discussed in #34317, if a custom annotation is meta-annotated with @Component
and declares a local String value
attribute that is explicitly configured (via @AliasFor
) as an override for an attribute other than Component.value
, the local value
attribute is still used as a convention-based override for Component.value
.
The result is that a local value
attribute will be used as a custom @Component
name, even when that is clearly not the intent.
In light of that, we will stop using a value
attribute that is explicitly aliased to something other than @Component.value
as the @Component
name, beginning with Spring Framework 7.0.
Related Issues
- AnnotationTypeMapping tracks @AliasFor mappings as convention-based #28773
- Look up
@Component
stereotype names using@AliasFor
semantics #31089 - Remove convention-based annotation attribute override support #28761
AnnotationBeanNameGenerator
issues warning about explicitly aliasedvalue
attribute #34317