Overview

Historically, @Component stereotype names were only configurable via implicit convention-based annotation attribute overrides of the String value() attribute; however, Spring Framework 4.2 introduced support for explicit annotation attribute overrides via @AliasFor. In addition, #20615 introduced the use of @AliasFor for @Component(value) in core stereotype annotations (@Service, @Controller, @Repository, @Configuration, @RestController), but the framework did not actually rely on @AliasFor support when looking up a component name via stereotype annotations until #31089.

Since explicit overrides are favorable to implicit overrides, and since the support for convention-based overrides increases the complexity of Spring's annotation search algorithms, we will deprecate convention-based overrides for @Component stereotype names in 6.1.

Related Issues

  • 20615

  • 21108

  • 28760

  • 31089

Deliverables

  • [x] Update Javadoc and reference documentation to inform users that convention-based overrides for @Component(value) are deprecated in favor of @AliasFor(annotation = Component.class, attribute = "value").
  • [x] Whenever a convention-based override for @Component(value) is detected, log a warning stating the reasons mentioned above.