Announcement Announcement Module
No announcement yet.
The same package in multiple jars and component-scan Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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 =""> Problem is that when I'm trying to execute tests from target/test-classes using this context definion only beans from package are taken into account during context creation. Beans from packed from target/classes are omitted during context creation. Is there any way to force spring to scan classes from target/classes directory ?