title: exclude file from maven build
body: <p>I've a web application with file src/main/webapp/META-INF/context.xml which contains some configuration for testing database. On production server this file is in $TOMCAT_HOME/conf/Catalina/localhost/ROOT.xml and I'm testing with embedded tomcat so I don't want to package this file. I'd like to exclude this file from maven build. I tried following:</p>
  
  <pre><code>&lt;build&gt;
    ...
    &lt;resources&gt;
      &lt;resource&gt;
        &lt;directory&gt;src/main/webapp/META-INF&lt;/directory&gt;
        &lt;filtering&gt;true&lt;/filtering&gt;
        &lt;excludes&gt;
          &lt;exclude&gt;context.xml&lt;/exclude&gt;
        &lt;/excludes&gt;
      &lt;/resource&gt;
    &lt;/resources&gt;
  &lt;/build&gt;
  </code></pre>
  
  <p>and also following:</p>
  
  <pre><code>&lt;build&gt;
    ...
    &lt;plugin&gt;
      &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
      &lt;artifactId&gt;maven-war-plugin&lt;/artifactId&gt;
      &lt;configuration&gt;
        &lt;resources&gt;
          &lt;resource&gt;
            &lt;directory&gt;src/main/webapp/META-INF&lt;/directory&gt;
            &lt;filtering&gt;true&lt;/filtering&gt;
            &lt;excludes&gt;
              &lt;exclude&gt;context.xml&lt;/exclude&gt;
            &lt;/excludes&gt;
          &lt;/resource&gt;
        &lt;/resources&gt;
      &lt;/configuration&gt;
    &lt;/plugin&gt;
  &lt;/build&gt;
  </code></pre>
  
  <p>But the file still gets packaged in war and in build directory (eg. target/myapp-1.0-SNAPSHOT/META-INF/context.xml). What am I doing wrong?</p>