title: dependency classes not loaded in executable jar
body: <p><img src="https://reflectoring.io/assets/images/posts/spring-boot-modules/spring-boot-modules.jpg" alt="spring modules"></p>
  
  <p>I'm trying to create Several Spring boot applications and merge those and create a one FAT jar (then I can deploy those as separate jars and also can create one jar [micro services and monolithic])</p>
  
  <p>refer :  <a href="https://medium.com/@eranda/combine-multiple-springboot-applications-into-a-single-application-649514e7a447" rel="nofollow noreferrer">https://medium.com/@eranda/combine-multiple-springboot-applications-into-a-single-application-649514e7a447</a></p>
  
  <p>It's working fine on eclipse IDE but does not work when I build and run Jar.</p>
  
  <ol>
  <li>parent class</li>
  </ol>
  
  <pre class="lang-java prettyprint-override"><code>    package com.examp.dcms;
  
      import org.springframework.boot.SpringApplication;
      import org.springframework.boot.autoconfigure.SpringBootApplication;
      import org.springframework.context.annotation.ComponentScan;
  
      @SpringBootApplication
      //@ComponentScan(basePackages ={"com.examp.dcms.customer","com.examp.dcms.audit"})
      public class ApiApplication{
  
      public static void main(String[] args) {
          SpringApplication.run(ApiApplication.class, args);
      }
  }
  </code></pre>
  
  <ol start="2">
  <li><p>POM xml of parent project(ApiApplication pom)</p>
  
  <pre><code>&lt;&lt;dependency&gt;&gt;
      &lt;groupId&gt;com.epic&lt;/groupId&gt;
      &lt;artifactId&gt;dcms-audit-service&lt;/artifactId&gt;
      &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
      &lt;groupId&gt;com.epic&lt;/groupId&gt;
      &lt;artifactId&gt;dcms-customer-service&lt;/artifactId&gt;
      &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
  &lt;/dependency&gt;
  </code></pre></li>
  </ol>
  
  <p>I have 3 rest endpoints one inside API application and each in Customer and Audit,</p>
  
  <p>when I'm running on IDE I can get response from all the endpoints, but when I'm building jar and executing only ApiApplication endpoint is working other two are not working(404) , they are not even being constructed when I'm running as a jar, tried to add componetScan on the parent application didn't work.</p>