title: Exclude application.properties when generating war using spring boot and spring-boot-maven-plugin
body: <p>I am developing a web application using Spring Boot, and want to generate war instead of jar.</p>
  
  <p>It works very fine using the conversion from jar to war described here : <a href="http://spring.io/guides/gs/convert-jar-to-war/" rel="noreferrer">http://spring.io/guides/gs/convert-jar-to-war/</a></p>
  
  <p>But I want to exclude the application.properties from the war, because I use <code>@PropertySource(value = "file:${OPENSHIFT_DATA_DIR}/application.properties")</code> to get the file path on production environment.</p>
  
  <ul>
  <li><p>This method works when generating my war, but in eclipse I can't run my application because application.properties not copied at all to target/classes :</p>
  
  <pre><code>&lt;build&gt;
      &lt;resources&gt; 
          &lt;resource&gt; 
              &lt;directory&gt;src/main/resources&lt;/directory&gt; 
              &lt;excludes&gt; 
                  &lt;exclude&gt;application.properties&lt;/exclude&gt; 
              &lt;/excludes&gt; 
          &lt;/resource&gt; 
       &lt;/resources&gt; 
  &lt;/build&gt;
  </code></pre></li>
  <li><p>This method doesn't work at all, I think that spring-boot-maven-plugin doesn't support packagingExcludes :</p>
  
  <pre><code>&lt;build&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;configuration&gt; 
                  &lt;packagingExcludes&gt;WEB-INF/classes/application.properties&lt;/packagingExcludes&gt; 
              &lt;/configuration&gt; 
          &lt;/plugin&gt;
      &lt;/plugins&gt;
  &lt;/build&gt;
  </code></pre></li>
  </ul>
  
  <p>Have you another suggestion?</p>
  
  <p>Thanks</p>