title: How to change the way Spring Boot serves static files?
body: <p>After using JHipster on a couple of new projects recently (Highly recommended ! Amazing work !), I am trying to back-port some of the concepts into an older webapp, essentially migrating it to Spring Boot and Angular.</p>
  
  <p>In Spring Boot, the default location for static web resources (HTML, JS, CSS, etc.) is in a directory called <code>public</code>, <code>static</code> or <code>resources</code> located at the root of the classpath. Any of these directories will be picked up by spring boot and files in them will be accessible via HTTP.</p>
  
  <p>In JHipster the web files are in the <code>src/main/webapp</code> directory. Which is the directory used by default in a classic Maven WAR project.</p>
  
  <p>I like this better because :</p>
  
  <ul>
  <li>it more clearly separates the static web stuff from the classpath resources used by the Java code</li>
  <li>the nesting is less deep (we already have enough levels of directories nesting with Maven as it is!).</li>
  </ul>
  
  <p>But if I just create webapp directory in my project and put my HTML files in it, they are not available via HTTP, and the build process creates the <code>WEB-INF</code> directory structure in it. I don't want that, and in JHipster this is not the case.</p>
  
  <p><strong>How can I configure Spring Boot to behave like it does in JHipster ?</strong></p>
  
  <p>For those not familiar with JHipster : <strong>How can I instruct Spring Boot to serve static files from a different folder, no included in the classpath ?</strong></p>