title: Spring boot app does not serve static resources after packaging into jar
body: <p>I have a application that work perfectly fine when started via ide or command line: mvn spring-boot:run. But when i package it into jar, I cannot access static resources(404 not found). I did not want to store static files in resource fouler so i don`t have to reload the server each time i need to change static file. So i used this plugin in my pom.xml:</p>
  
  <pre><code>              &lt;plugin&gt;
                  &lt;artifactId&gt;maven-resources-plugin&lt;/artifactId&gt;
                  &lt;version&gt;2.6&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;${basedir}/target/classes/static&lt;/outputDirectory&gt;
                              &lt;resources&gt;
                                  &lt;resource&gt;
                                      &lt;directory&gt;src/main/webapp&lt;/directory&gt;
                                      &lt;filtering&gt;true&lt;/filtering&gt;
                                  &lt;/resource&gt;
                              &lt;/resources&gt;
                          &lt;/configuration&gt;
                      &lt;/execution&gt;
                  &lt;/executions&gt;
              &lt;/plugin&gt;
  </code></pre>
  
  <p>I can see that files are being copied in two the directory "static". 
  This is my configuration of resource handler:</p>
  
  <pre><code>    @Configuration
      @EnableWebMvc
      public class WebMvcConfig extends WebMvcConfigurerAdapter {
  
      @Override
      public void addResourceHandlers(ResourceHandlerRegistry registry) {
          registry.addResourceHandler("/**").addResourceLocations("/");
      }
  </code></pre>
  
  <p>Controllers RequestMappings are working fine, problems are only with the static resources.</p>