views:

71

answers:

1

I tried this to exclude whole directory (${basedir}/src/main/webapp/webscripts) from my WAR file but it failed. What is wrong?

this doesn't work:

<configuration>
   <webResources>
      <resource>
       <directory>${basedir}/src/main/webapp/webscripts</directory>
       <excludes>
        <exclude>**/*.*</exclude>
       </excludes>
      </resource>
   </webResources>
</configuration>

this too:

<configuration>
   <webResources>
      <resource>
       <directory>${basedir}/src/main/webapp</directory>
       <excludes>
        <exclude>**/webscripts</exclude>
       </excludes>
      </resource>
   </webResources>
</configuration>

Can anybody help?

+4  A: 

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 resourse mechanism.

The mechanism to deactivate a part of that is through the warSourceExcludes parameter. Probably like this:

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

(I am not sure about the exact syntax)

seanizer
thank you much!!! That helped me!
pls
Then you should accept the answer. Read http://meta.stackoverflow.com/questions/5234/how-does-accepting-an-answer-work
seanizer
Yes, that's it +1
Pascal Thivent
Thanks, seanizer, I'm a new-comer here)
pls