Closed
Description
Oliver Drotbohm opened SPR-8880 and commented
Suppose you have an application with a base package of com.acme
with an @Configuration
class located in this package. Now suppose you use this configuration class as basePackageClass
inside @ComponentScan
. This will result in an exception saying the class is registered twice. So you pretty much end up with always adding this exclude.
Would it make sense to default the excludeFilters
attribute of the @ComponentScan
annotation as follows?
@Filter(type = FilterType.ANNOTATION, value = Configuration.class)
Affects: 3.1 RC2
Issue Links:
- Allow @Configuration classes to self-@ComponentScan [SPR-8808] #13450 Allow
@Configuration
classes to self-@ComponentScan
("duplicates")