Hi,
I noticed some strange behavior of context:component-scan. I thought that packages from multiple component-scan declarations are combined together with corresponding exclude/include-filter values. Unfortunately it seems that exclude-filter is taken into consideration only when a package is not included in any other component-scan.
In the following example a bean in foo.bar.sub package will not be excluded:
Is it an expected behavior?Code:<context:component-scan base-package="foo"/> <context:component-scan base-package="foo.bar"> <context:exclude-filter type="regex" expression="foo.bar.sub.*"/> </context:component-scan>
It can tend to hard to find problems when some included XML configuration accidentally does scanning at higher package level. Tested with Spring 3.0.6.
Regards
Marcin


Reply With Quote
