Cannot use @Primary to override @ComponentScan-ed beans [SPR-10795] #15421
Labels
in: core
Issues in core modules (aop, beans, core, context, expression)
status: declined
A suggestion or change that we don't feel we should currently apply
Mike opened SPR-10795 and commented
A
@Primary @Bean
cannot override a@ComponentScan
-ed@Component
.For example, if I have:
and a scanned:
... the
@Component
will always be@Autowired
instead of the@Primary
-annotated@Bean
. Nothing in the documentation says that@Primary @Bean
's should fail against@ComponentScan
-ed ones.Affects: 3.2.3
Reference URL: http://stackoverflow.com/questions/17945290/spring-primary-fails-against-componentscan
Issue Links:
@ComponentScan
are skipped in@Configuration
override4 votes, 8 watchers
The text was updated successfully, but these errors were encountered: