views:

131

answers:

1

I followed the instructions here, and it worked but only if it was mapped to a directory other than the default.

Here's a sample that I tried:

<configuration>
     <webResources>
          <resource>
              <directory>${basedir}/src/main/webapp/WEB-INF</directory>
           <!-- the below works when uncommented and does exclude *.tmp -->
              <!-- <targetPath>test/WEB-INF</targetPath> -->
              <!-- the below does not -->
              <targetPath>WEB-INF</targetPath>
              <excludes>
                <exclude>*.tmp</exclude>
              </excludes>
          </resource>
      </webResources>
</configuration>

So my assumptions is that I have something else overriding the configuration. However, this is my first project using maven, so I'm not sure what to test or investigate next.

A: 

change your exclusion to

**/*.tmp

You could also leave off the WEB-INF from the directory and remove the targetDirectory altogether. For instance, here's one that would include all xml, xhtml, x*ml etc. and excludes all *.tmp in any directory

<webResources>
    <resource>
        <directory>${basedir}/src/main/webapp</directory>
        <includes>
            <include>**/*.x*ml</include>
        </includes>
        <excludes>
            <exclude>**/*.tmp</exclude>
        </excludes>
    </resource>
</webResources>
digitaljoel