Jan 5th, 2009, 09:39 AM
The same package in multiple jars and component-scan
I'm dealing with situation like this. There are two the same package in to classpath elements: target/classes and target/test-classes. It is a good practise when maven is used. In target/classes some classes marked with Component annotation exists. There is spring context definition file placed in target/test-classes. This file conteins <context:component-scan base-package ="foo.bar"> Problem is that when I'm trying to execute tests from target/test-classes using this context definion only beans from package foo.bar are taken into account during context creation. Beans from packed foo.bar from target/classes are omitted during context creation. Is there any way to force spring to scan classes from target/classes directory ?