title: Build angular 11 with Spring boot 2.x in one single jar
body: <p>I am facing  an issue bulding an angular 11 with Springboot jar.
  If I runn separatelly the apps (the backend on 8080 and the ui on 4200) they work just fine, the connection and calls in between are ok and stable.</p>
  <p>What I am trying to do is actually integrate this. I've seen plenty of examples but I don't know where and what Am I doing wrong.</p>
  <p>Here is a picture of the Project structure:<a href="https://i.stack.imgur.com/MJGgR.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/MJGgR.jpg" alt="enter image description here" /></a></p>
  <p>Here are the maven plugins which are installing and copying the ui build stuff into the jar.</p>
  <pre><code>   &lt;plugin&gt;
          &lt;groupId&gt;com.github.eirslett&lt;/groupId&gt;
          &lt;artifactId&gt;frontend-maven-plugin&lt;/artifactId&gt;
          &lt;version&gt;${frontend-maven-plugin.version}&lt;/version&gt;
          &lt;configuration&gt;
              &lt;nodeVersion&gt;${node.version}&lt;/nodeVersion&gt;
              &lt;workingDirectory&gt;${frontendSrcDir}&lt;/workingDirectory&gt;
              &lt;installDirectory&gt;${project.build.directory}&lt;/installDirectory&gt;
              &lt;environmentVariables&gt;
                  &lt;CI&gt;true&lt;/CI&gt;
              &lt;/environmentVariables&gt;
              &lt;!--suppress UnresolvedMavenProperty --&gt;
              &lt;skip&gt;${skip.ui}&lt;/skip&gt;
          &lt;/configuration&gt;
          &lt;executions&gt;
              &lt;execution&gt;
                  &lt;id&gt;install-frontend-tools&lt;/id&gt;
                  &lt;goals&gt;
                      &lt;goal&gt;install-node-and-npm&lt;/goal&gt;
                  &lt;/goals&gt;
                  &lt;configuration&gt;
                      &lt;nodeVersion&gt;v14.16.0&lt;/nodeVersion&gt;
                      &lt;npmVersion&gt;6.14.13&lt;/npmVersion&gt;
                  &lt;/configuration&gt;
              &lt;/execution&gt;
              &lt;execution&gt;
                  &lt;id&gt;npm-install&lt;/id&gt;
                  &lt;goals&gt;
                      &lt;goal&gt;npm&lt;/goal&gt;
                  &lt;/goals&gt;
                  &lt;configuration&gt;
                      &lt;arguments&gt;install&lt;/arguments&gt;
                  &lt;/configuration&gt;
              &lt;/execution&gt;
              &lt;execution&gt;
                  &lt;id&gt;build-frontend&lt;/id&gt;
                  &lt;goals&gt;
                      &lt;goal&gt;npm&lt;/goal&gt;
                  &lt;/goals&gt;
                  &lt;phase&gt;prepare-package&lt;/phase&gt;
                  &lt;configuration&gt;
                      &lt;arguments&gt;run build --prod&lt;/arguments&gt;
                  &lt;/configuration&gt;
              &lt;/execution&gt;
          &lt;/executions&gt;
      &lt;/plugin&gt;
      &lt;plugin&gt;
          &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
          &lt;artifactId&gt;maven-resources-plugin&lt;/artifactId&gt;
          &lt;executions&gt;
              &lt;execution&gt;
                  &lt;id&gt;angular-build&lt;/id&gt;
                  &lt;goals&gt;
                      &lt;goal&gt;copy-resources&lt;/goal&gt;
                  &lt;/goals&gt;
                  &lt;phase&gt;validate&lt;/phase&gt;
                  &lt;configuration&gt;
                      &lt;outputDirectory&gt;${project.build.outputDirectory}/static&lt;/outputDirectory&gt;
                      &lt;resources&gt;
                          &lt;resource&gt;
                              &lt;directory&gt;${frontendSrcDir}/dist/ui&lt;/directory&gt;
                          &lt;/resource&gt;
                      &lt;/resources&gt;
                  &lt;/configuration&gt;
              &lt;/execution&gt;
          &lt;/executions&gt;
      &lt;/plugin&gt;
  </code></pre>
  <p>In the jar the build files are copied under jar/BOOT-INF/classes/static.
  Here is the image <a href="https://i.stack.imgur.com/xU7fM.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/xU7fM.jpg" alt="enter image description here" /></a></p>
  <p>What Am I missing?</p>