You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Motivation: Given a library's auto-configuration requiring a bean of a specific type to be present in the application context, the resolution will fail if there is more than one bean present. One could annotate one of the beans as @Primary, however there are cases when you want the auto-configuration to pick up the secondary (not @Primary annotated) bean.
Suggestion: Allow providing a "scoped" or "hierarchical" bean qualification mechanism for a specific auto-configuration and/or configuration classes in a specific package, such that bean resolution works as if there was an explicit @Qualifier annotation present on all injection points.
This could also help solving issue #22403 , e.g. using something like resolution.hideExistingBean(ObjectMapper.class) on Spring's auto-configuration class that provides an ObjectMapper.
The text was updated successfully, but these errors were encountered:
Thanks for the suggestion, but we need to consider more use-cases for #22403 before we can implement any fix. We also want to involve the Spring Framework team since we expect that changes may be required to the core.
I'll close this one for now as a duplicate of #22403
Motivation: Given a library's auto-configuration requiring a bean of a specific type to be present in the application context, the resolution will fail if there is more than one bean present. One could annotate one of the beans as
@Primary
, however there are cases when you want the auto-configuration to pick up the secondary (not@Primary
annotated) bean.Suggestion: Allow providing a "scoped" or "hierarchical" bean qualification mechanism for a specific auto-configuration and/or configuration classes in a specific package, such that bean resolution works as if there was an explicit
@Qualifier
annotation present on all injection points.Example SPI:
This could also help solving issue #22403 , e.g. using something like
resolution.hideExistingBean(ObjectMapper.class)
on Spring's auto-configuration class that provides anObjectMapper
.The text was updated successfully, but these errors were encountered: