I am working on a project in Spring, which consists of some small project and dependencies. Here's the simple hierarchy of the parent project:
- A (a war, the rest web services that will be exposed)
- B (another war, which will also be exposed)
- C (jar dependecies for A and B)
- D (jar dependencies for A and B)
Here's a snippet of my context.xml
<context:component-scan
base-package="com.mycompany.project.C, com.mycompany.project.D,
com.mycompany.project.A"/>
<context:property-placeholder location="classpath:application.properties"/>
<mvc:default-servlet-handler/>
<mvc:annotation-driven/>
Everytime I deployed project A, I see in the log that spring is also scanning @Controller and @Service from project B. My question is how can it happen? Is my xml configuration wrong? Please advice.
*I've searched for similar question but can't find any. If you find one, please let me know, maybe I wasn't searching thouroughly.
Thanks