title: Maven filtering not select the good files
body: <p><strong><em>My project structure:</em></strong></p>
  
  <pre><code>- src
      - main
      - java
      - resources
      |   -hibernate.cfg.xml
      |   -log4j.properties
      - config
      |   -dev
      |   |   -hibernate.cfg.xml
      |   |   -log4j.properties
  </code></pre>
  
  <p>I use <code>maven-war-plugin</code> for filtering with maven.</p>
  
  <p><strong><em>pom.xml:</em></strong></p>
  
  <pre><code>&lt;profiles&gt;
      &lt;profile&gt;
          &lt;id&gt;dev&lt;/id&gt;
          &lt;activation&gt;
              &lt;activeByDefault&gt;true&lt;/activeByDefault&gt;
          &lt;/activation&gt;
          &lt;properties&gt;
              &lt;profileVersion&gt;DEV&lt;/profileVersion&gt;
              &lt;filterFile&gt;src/main/filters/filter-dev.properties&lt;/filterFile&gt;
              &lt;configFolder&gt;src/main/config/dev/&lt;/configFolder&gt;
          &lt;/properties&gt;
      &lt;/profile&gt;
  &lt;/profiles&gt;
  &lt;plugin&gt;
      &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
      &lt;artifactId&gt;maven-war-plugin&lt;/artifactId&gt;
      &lt;version&gt;2.6&lt;/version&gt;
      &lt;configuration&gt;
          &lt;filters&gt;
              &lt;filter&gt;src/main/filters/filter.properties&lt;/filter&gt;
              &lt;filter&gt;${filterFile}&lt;/filter&gt;
          &lt;/filters&gt;
          &lt;filteringDeploymentDescriptors&gt;true&lt;/filteringDeploymentDescriptors&gt;
          &lt;webResources&gt;
              &lt;resource&gt;
                  &lt;directory&gt;${configFolder}&lt;/directory&gt;
                  &lt;includes&gt;
                      &lt;include&gt;log4j.properties&lt;/include&gt;
                      &lt;include&gt;hibernate.cfg.xml&lt;/include&gt;
                  &lt;/includes&gt;
                  &lt;targetPath&gt;/WEB-INF/classes/&lt;/targetPath&gt;
              &lt;/resource&gt;
          &lt;/webResources&gt;
          &lt;failOnMissingWebXml&gt;false&lt;/failOnMissingWebXml&gt;
      &lt;/configuration&gt;
      &lt;executions&gt;
          &lt;execution&gt;
              &lt;id&gt;default-war&lt;/id&gt;
              &lt;phase&gt;none&lt;/phase&gt;
              &lt;goals&gt;
                  &lt;goal&gt;war&lt;/goal&gt;
              &lt;/goals&gt;
          &lt;/execution&gt;
          &lt;execution&gt;
              &lt;id&gt;package-war&lt;/id&gt;
              &lt;phase&gt;package&lt;/phase&gt;
              &lt;goals&gt;
                  &lt;goal&gt;war&lt;/goal&gt;
              &lt;/goals&gt;
          &lt;/execution&gt;
      &lt;/executions&gt;
  &lt;/plugin&gt;
  </code></pre>
  
  <p><strong><em>Output console:</em></strong></p>
  
  <pre><code>[INFO] --- maven-war-plugin:2.6:war (package-war) @ with ---
  [INFO] Packaging webapp
  [INFO] Assembling webapp [with] in [D:\workspace\with\target\with-0.0.1-SNAPSHOT]
  [INFO] Processing war project
  [INFO] Copying webapp webResources [D:\workspace\with\src/main/config/dev/] to [D:\workspace\with\target\with-0.0.1-SNAPSHOT]
  [INFO] Copying webapp webResources [D:\workspace\with\src/main/config/dev/] to [D:\workspace\with\target\with-0.0.1-SNAPSHOT]
  [INFO] Copying webapp resources [D:\workspace\with\src\main\webapp]
  [INFO] Webapp assembled in [13732 msecs]
  [INFO] Building war: D:\workspace\with\target\with-0.0.1-SNAPSHOT.war
  [INFO]
  </code></pre>
  
  <p>My problem is when i see in the <code>war</code> file <code>hibernate.cfg.xml</code> and <code>log4J.properties</code> are not those of the <code>dev</code> profile but those <code>resources</code> folder, why ..?</p>