title: Maven - Spring Refer Bean from Interface
body: <p>I have following scenario and need advice on how to handle.</p>
  
  <p>My project is Maven module with spring.</p>
  
  <p>I have following modules.</p>
  
  <p>1.module A - WAR</p>
  
  <p>2.module B - WAR</p>
  
  <p>3.module C - JAR</p>
  
  <p>Module dependency as follows.</p>
  
  <p>module A and B have module C as dependency. </p>
  
  <p>I have a service which related to module A. The implementation is done in module A. This service needs to be access by module B. Now what i did was to introduce a interface to module C (jar) to access this service. The implementation is left on module A ( which service really belongs). Module B access this service through interface and project compiles. But the problem is spring cannot create bean for this service in module B. This is understandable since bean ( implementation ) never there in module B's dependency list. How can I address this ? I don't want to move whole service to module B since it would be huge code duplicate.</p>