title: resources in a Spring Boot application are missing from jar file when using Spring Boot Maven Plugin
body: <p>I am using Spring-Boot v1.3.0.M5 with Maven v3.3.3. I used to be able to run my Spring Boot (boot) application from the console with this command.</p>
  
  <p><code>mvn clean package spring-boot:run</code></p>
  
  <p>However, I've had to revise my <code>pom.xml</code> to account for different environment builds. In particular, I am using Maven profiles to modify the properties files of boot application. Now when I run the previously mentioned command, the boot application fails to run and complains with the following exception.</p>
  
  <blockquote>
    <p>Caused by: java.lang.NumberFormatException: For input string: "${MULTIPART.MAXREQUESTSIZE}"</p>
  </blockquote>
  
  <p>I have a properties file located at <code>src/main/resources/config/application.properties</code>. And this properties file has a bunch of key-value pairs which looks like the following.</p>
  
  <pre><code>multipart.maxFileSize=${multipart.maxFileSize}
  multipart.maxRequestSize=${multipart.maxRequestSize}
  </code></pre>
  
  <p>Then in my <code>pom.xml</code>, my build is defined as follows.</p>
  
  <pre><code>&lt;build&gt;
      &lt;resources&gt;
          &lt;resource&gt;
              &lt;directory&gt;src/main/resources&lt;/directory&gt;
              &lt;filtering&gt;true&lt;/filtering&gt;
              &lt;includes&gt;
                  &lt;include&gt;**/*.properties&lt;/include&gt;
              &lt;/includes&gt;
          &lt;/resource&gt;
          &lt;resource&gt;
              &lt;directory&gt;src/main/resources&lt;/directory&gt;
              &lt;filtering&gt;false&lt;/filtering&gt;
              &lt;excludes&gt;
                  &lt;exclude&gt;**/*.properties&lt;/exclude&gt;
              &lt;/excludes&gt;
          &lt;/resource&gt;
      &lt;/resources&gt;
      &lt;plugins&gt;
          &lt;plugin&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-maven-plugin&lt;/artifactId&gt;
          &lt;/plugin&gt;
      &lt;/plugins&gt;
  &lt;/build&gt;
  &lt;profiles&gt;
      &lt;!-- development --&gt;
      &lt;profile&gt;
          &lt;id&gt;env-dev&lt;/id&gt;
          &lt;activation&gt;
              &lt;activeByDefault&gt;true&lt;/activeByDefault&gt;
              &lt;property&gt;
                  &lt;name&gt;env&lt;/name&gt;
                  &lt;value&gt;dev&lt;/value&gt;
              &lt;/property&gt;
          &lt;/activation&gt;
          &lt;properties&gt;
              &lt;multipart.maxFileSize&gt;250MB&lt;/multipart.maxFileSize&gt;
              &lt;multipart.maxRequestSize&gt;250MB&lt;/multipart.maxRequestSize&gt;
          &lt;/properties&gt;
      &lt;/profile&gt;
      &lt;!-- staging --&gt;
      &lt;profile&gt;
          &lt;id&gt;env-stg&lt;/id&gt;
          &lt;activation&gt;
              &lt;activeByDefault&gt;false&lt;/activeByDefault&gt;
              &lt;property&gt;
                  &lt;name&gt;env&lt;/name&gt;
                  &lt;value&gt;stg&lt;/value&gt;
              &lt;/property&gt;
          &lt;/activation&gt;
          &lt;properties&gt;
              &lt;multipart.maxFileSize&gt;500MB&lt;/multipart.maxFileSize&gt;
              &lt;multipart.maxRequestSize&gt;500MB&lt;/multipart.maxRequestSize&gt;
          &lt;/properties&gt;
      &lt;/profile&gt;
  &lt;profiles&gt;
  </code></pre>
  
  <p>I noticed that if I type in <code>mvn clean package</code> and look inside the <code>jar</code> file, the <code>application.properties</code> file is inside the jar. </p>
  
  <p>However, if I type in <code>mvn clean package spring-boot:run</code>, then the <code>applications.properties</code> file is <strong>not</strong> inside the jar. In fact, nothing under <code>src/main/resources</code> makes it into the jar file.</p>
  
  <p>This problem is a little annoying for me because if I want to run my boot application from the command line, I have to do two steps now.</p>
  
  <ol>
  <li><code>mvn clean package</code></li>
  <li><code>java -jar ./target/app-0.0.1-SNAPSHOT.jar</code></li>
  </ol>
  
  <p>Any ideas on what I am doing wrong?</p>