maven2: excluding directory from WAR

Both of your solutions wouldn’t help, as they would add an additional resource that is then deactivated. The webapp source folder is copied by default, without the resource mechanism.

The mechanism to deactivate a part of that is through the <warSourceExcludes> parameter, like this:

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-war-plugin</artifactId>
    <version>2.1</version>
    <configuration>
        <warSourceExcludes>webscripts/**</warSourceExcludes>
    </configuration>
</plugin>

Leave a Comment