title: How to configure Maven profiles with different resources folders?
body: <p>I'm trying to configure my application to have 2 build profiles: development and production. In order to do that, I created two subdirectories under the <strong>src/main/resources</strong> folder: <strong>src/main/resources/development</strong> and <strong>src/main/resources/production</strong>. Each subdirectory has its own .properties files.</p>
  
  <pre><code>&lt;profiles&gt;
      &lt;profile&gt;
          &lt;id&gt;development&lt;/id&gt;
          &lt;build&gt;
              &lt;resources&gt;
                  &lt;resource&gt;
                      &lt;directory&gt;src/main/resources/development&lt;/directory&gt;
                  &lt;/resource&gt;
              &lt;/resources&gt;
          &lt;/build&gt;
      &lt;/profile&gt;
      &lt;profile&gt;
          &lt;id&gt;production&lt;/id&gt;
          &lt;build&gt;
              &lt;resources&gt;
                  &lt;resource&gt;
                      &lt;directory&gt;src/main/resource/production&lt;/directory&gt;
                  &lt;/resource&gt;
              &lt;/resources&gt;
          &lt;/build&gt;
      &lt;/profile&gt;
  &lt;/profiles&gt;
  </code></pre>
  
  <p>I build the app with the command mvn install -P ${profile_here}</p>
  
  <p>Maven copies the content of the folder related to the chosen profile to the WEB-INF/classes output directory, however the development and production folders are copied as well.</p>
  
  <p>WEB-INF/classes</p>
  
  <p>WEB-INF/classes/development </p>
  
  <p>WEB-INF/classes/production</p>
  
  <p>How can I solve this problem?</p>
  
  <p>Thanks in advance.  </p>