title: Cannot package Spring Boot application properly in a multi module project
body: <p>Basically, I have a multi module project as follows:</p>
  
  <pre><code>parent-project
  ├── core-app
  └── web-app
  </code></pre>
  
  <p><code>core-app</code> and <code>web-app</code> are both Spring Boot projects, and their parent is <code>parent-project</code> instead of <code>spring-boot-starter-parent</code>. So because of it, they both have:</p>
  
  <pre><code>&lt;dependencyManagement&gt;
          &lt;dependencies&gt;
              &lt;dependency&gt;
                  &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
                  &lt;artifactId&gt;spring-boot-dependencies&lt;/artifactId&gt;
                  &lt;type&gt;pom&lt;/type&gt;
                  &lt;version&gt;${spring.boot.version}&lt;/version&gt;
                  &lt;scope&gt;import&lt;/scope&gt;
              &lt;/dependency&gt;
          &lt;/dependencies&gt;
      &lt;/dependencyManagement&gt;
  </code></pre>
  
  <p>in their <code>pom.xml</code>, as well as:</p>
  
  <pre><code>&lt;plugin&gt;
      &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
      &lt;artifactId&gt;spring-boot-maven-plugin&lt;/artifactId&gt;
      &lt;version&gt;${spring.boot.version}&lt;/version&gt;
      &lt;configuration&gt;
          &lt;executable&gt;true&lt;/executable&gt;
      &lt;/configuration&gt;
  &lt;/plugin&gt;
  </code></pre>
  
  <p>This setup perfectly runs within IntelliJ, yet, if I <code>package</code> the application, I get a very small <code>.jar</code> and basically if I try to run it executable, I get several <code>command not found</code> errors.</p>
  
  <p>If I run it with <code>java -cp my.jar com.Main</code> I get <code>SpringApplication not found</code>. So from this, I understand that the <code>core-app</code> and <code>web-app</code> doesn't have all the dependencies within the jar.</p>
  
  <p>If I build it into a standalone <code>.jar</code> with <code>spring-boot-starter-parent</code> as its parent; it works.</p>
  
  <p>What am I doing wrong? Thanks.</p>
  
  <p><strong>Update:</strong></p>
  
  <p>Now that was what's happening when I <code>mvn package</code>. However, when I actually execute <code>mvn spring-boot:repackage</code> I am getting:</p>
  
  <pre><code>Execution default-cli of goal org.springframework.boot:spring-boot-maven-plugin:1.5.2.RELEASE:repackage failed: Source must refer to an existing file
  </code></pre>
  
  <p>As suggested here <a href="https://stackoverflow.com/a/38279392">this</a> seems to solve the issue, yet I doubt that it might not be the standard way. For example:</p>
  
  <p><code>mvn clean package spring-boot:repackage</code> does the trick, however, I cannot <code>mvn clean &amp;&amp; mvn package &amp;&amp; mvn spring-boot:repackage</code>. I would appreciate an explanation on this. Thanks!</p>