title: Spring Boot Autowiring From Another Module
body: <p>I am trying to establish connection between 3 modules in my project. When I try to reach my object with @Autowired error shows up. I'll explain my scenario a little bit.</p>
  
  <h1>MODULES</h1>
  
  <p><a href="https://i.stack.imgur.com/fzVwe.png" rel="noreferrer"><img src="https://i.stack.imgur.com/fzVwe.png" alt="enter image description here"></a></p>
  
  <p>All of these modules have been connected inside of pom.xml. Lets talk about my problem.</p>
  
  <h1>C -> ROUTE.JAVA</h1>
  
  <pre><code>.
  .
  .
  @Autowired
  public CommuniticationRepository;
  
  @Autowired
  public Core core;
  .
  .
  .
  </code></pre>
  
  <h1>B -> CORE</h1>
  
  <pre><code>public class Core {
      private int id;
      private String name;
      private Date date;
  
      public Core(int id, String name, Date date) {
          this.id = id;
          this.name = name;
          this.date = date;
      }
  
      public int getId() {
          return id;
      }
  
      public void setId(int id) {
          this.id = id;
      }
  
      public String getName() {
          return name;
      }
  
      public void setName(String name) {
          this.name = name;
      }
  
      public Date getDate() {
          return date;
      }
  
      public void setDate(Date date) {
          this.date = date;
      }
  }
  </code></pre>
  
  <h1>ERROR</h1>
  
  <blockquote>
    <p>Field communicationRepositoryin com.demo.xyz.A.RestControllers.Route required
    a bean of type 'com.demo.xyz.A.CommunicationRepository' that could not be
    found.</p>
    
    <p>Action:</p>
    
    <p>Consider defining a bean of type 'com.demo.xyz.A.CommunicationRepository' in
    your configuration.</p>
  </blockquote>
  
  <h1>A - > REPOSITORY.JAVA</h1>
  
  <pre><code>@Component
  @Repository
  public interface CommunicationRepository extends CrudRepository&lt;Communication, Date&gt; {
  
      List&lt;Communication&gt; findByDate(Date date);
  
      void countByDate(Date date);
  }
  </code></pre>