With the migration to Jakarta annotations in 6.0, we switched to supporting @jakarta.annotation.ManagedBean and @jakarta.inject.Named annotations for component scanning and component name lookups.

To better assist projects in the migration to Spring 6+, we should reinstate support for the legacy JSR-250 @javax.annotation.ManagedBean and JSR-330 @javax.inject.Named annotations so that existing compiled code will continue to work as expected.

Related Issues

  • 27444

  • 30695

Deliverables

  • [x] Support @javax.annotation.ManagedBean and @javax.inject.Named in ClassPathScanningCandidateComponentProvider#registerDefaultFilters(...).
  • [x] Support @javax.annotation.ManagedBean and @javax.inject.Named in AnnotationBeanNameGenerator#isStereotypeWithNameValue(...).
  • [x] Update tests.
  • [x] Update Javadoc.

Comment From: sbrannen

Current work on this feature can be viewed in the following feature branch: https://github.com/spring-projects/spring-framework/compare/main...sbrannen:spring-framework:issues/gh-31090-legacy-ManagedBean-and-Named-annotations