title: "A bean with that name has already been defined" error coming in spring boot multi module project
body: <p>I am working with one spring boot multi module maven project, here i am getting below exception, every time when i run application it fails for different different files.</p>
  
  <pre><code> The bean 'evServiceCpeRepository' could not be registered. A bean with that name has already been defined
  </code></pre>
  
  <p>this project has three module sbill , amr and executable ,</p>
  
  <p>this all classes i have in sbill module... amr module is empty it has just one controller and in amr module pom file i have added dependency for sbill module because amr module can access classes of sbill.</p>
  
  <p>executable module just contain spring boot main class , apart from that no any classes this module is executable module.</p>
  
  <pre><code> @SpringBootApplication
  @ComponentScan(basePackages = { "com"})
  @EntityScan(basePackages = { "com"})
   @EnableJpaRepositories(basePackages = { "com"})
   public class MainClass {public static void main(String[] args) {
   SpringApplication.run(MainClass.class, args);
   }}
  </code></pre>
  
  <p>pom of executable module</p>
  
  <pre><code>&lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"&gt;
     &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
     &lt;parent&gt;
      &lt;groupId&gt;com.sbill&lt;/groupId&gt;
        &lt;artifactId&gt;sbill-wrapper&lt;/artifactId&gt;
        &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
        &lt;/parent&gt;
         &lt;packaging&gt;war&lt;/packaging&gt;
        &lt;artifactId&gt;executable&lt;/artifactId&gt;
  
  &lt;dependencies&gt;
    &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-starter-web&lt;/artifactId&gt;
      &lt;/dependency&gt;
        &lt;dependency&gt;
         &lt;groupId&gt;com.sbill&lt;/groupId&gt;
         &lt;artifactId&gt;sbill&lt;/artifactId&gt;
           &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
         &lt;/dependency&gt; 
  
       &lt;dependency&gt;
      &lt;groupId&gt;com.sbill&lt;/groupId&gt;
      &lt;artifactId&gt;amr&lt;/artifactId&gt;
        &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;/dependencies&gt; 
  
  
  &lt;build&gt;
      &lt;plugins&gt;
          &lt;plugin&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-maven-plugin&lt;/artifactId&gt;
          &lt;/plugin&gt;
  
          &lt;!-- Adding  plugin of mavan resource to copy dist folder for  war --&gt;
          &lt;plugin&gt;
              &lt;artifactId&gt;maven-resources-plugin&lt;/artifactId&gt;
              &lt;version&gt;3.1.0&lt;/version&gt;
              &lt;executions&gt;
                  &lt;execution&gt;
                      &lt;id&gt;copy-resources&lt;/id&gt;
                      &lt;phase&gt;validate&lt;/phase&gt;
                      &lt;goals&gt;
                          &lt;goal&gt;copy-resources&lt;/goal&gt;
                      &lt;/goals&gt;
                      &lt;configuration&gt;
  
  
             &lt;outputDirectory&gt;${project.build.directory}/classes/static/&lt;/outputDirectory&gt;
                          &lt;resources&gt;
                              &lt;resource&gt;
                                  &lt;directory&gt;../web/dist&lt;/directory&gt;
                              &lt;/resource&gt;         
                          &lt;/resources&gt;            
                      &lt;/configuration&gt;            
                   &lt;/execution&gt;           
                  &lt;/executions&gt;
              &lt;/plugin&gt;
            &lt;/plugins&gt;       
         &lt;/build&gt;  
        &lt;/project&gt;       
  </code></pre>