-
Notifications
You must be signed in to change notification settings - Fork 38.6k
Description
Yannick Lazzari opened SPR-9100 and commented
There seems to be a difference in the way configuration classes, i.e. classes annotated with @Configuration
, are handled by the ClassPathBeanDefinitionScanner vs the AnnotatedBeanDefinitionReader. The javadoc says that the AnnotatedBeanDefinitionReader is, "...an alternative to ClassPathBeanDefinitionScanner, applying the same resolution of annotations but for explicitly registered classes only.". If you read the Spring forum thread attached to this issue report, you will find an example that shows that the way @ComponentScan
excludeFilters are processed is not the same; actually, they seemed to be totally ignored when the ClassPathBeanDefinitionScanner scans a class annotated in the following manner:
@Configuration
@ComponentScan
(basePackages={"com.foo", "com.bar"}, excludeFilters={@ComponentScan
.Filter(type = FilterType.ASSIGNABLE_TYPE, value = com.foo.ComponentA.class)})
public class TestConfig {
}
Affects: 3.1 GA
Reference URL: http://forum.springsource.org/showthread.php?122907-Spring-3-1-AnnotationConfigWebApplicationContext-scan-vs-register-method&p=400832
Issue Links:
- @ComponentScan with includeFilters on @Import-ed context does not work [SPR-9031] #13670
@ComponentScan
with includeFilters on@Import-ed
context does not work ("duplicates") - @ComponentScan does not work when referenced from XML config [SPR-7979] #12634
@ComponentScan
does not work when referenced from XML config - @ComponentScan(includeFilters=@Filter(...)) fails when @Import'ed [SPR-8719] #13361
@ComponentScan
(includeFilters=@Filter
(...)) fails when@Import
'ed