I'm mixed using AnnotationConfigApplicationContext
and ClasspathXmlApplicationContext
currently, and make AnnotationConfigApplicationContext
as the parent context. But I found that beans defined in AnnotationConfigApplicationContext
doesn't cope well with beans defined in ClasspathXmlApplicationContext
. So I'd like to drop ClasspathXmlApplicationContext
anyway, and make my application use AnnotationConfigApplicationContext
only.
The problem is, I don't know how to replace <context:component-scan>
totally. I can easily do a package scan using AnnotationConfigApplicationContext.scan(...)
, but there seems no way to add include/exclude pattern in AnnotationConfigApplicationContext
.
Any idea?