maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thorsten Heit" <>
Subject Re: How to exclude the contents from WEB-INF/classes from being copied over?
Date Mon, 10 Sep 2007 10:53:32 GMT

> While using MyEclipse with maven, I have the eclipse plug-in keeping the
> output directory as WEB-INF/classes so that I can still work with hot
> deploys.
> <plugin>
>         <groupId>org.apache.maven.plugins</groupId>
>         <artifactId>maven-eclipse-plugin</artifactId>
>         <configuration>
>           <outputDirectory>
>             src/main/webapp/WEB-INF/classes
>           </outputDirectory>
> <plugin>
> Eclipse copies the contents of both src/main and src/test to this location
> so the classes directory will contain * as well as *.java.
> When I do a mvn package on the war (outside of eclipse) maven copies
> everything in the webapp directory over, and then puts in all the non-test
> classes.  However, since the WEB-INF/classes dir wasn't empty (because
> eclipse is using it) all my tests and test resources get copied over as
> well.

Sure, because Maven treats them as web resources that have to be packaged into your WAR file...

> I've tried:
> 1) using the clean plug-in but that means when I switch back over to
> eclipse
> I have to do a full clean on that project
> 2) using an exclude filter for the war plug-in, but have not had any luck
> with that.
> Does anyone have a working solution to this?

Not a solution, but some questions:

1) Why don't you just use the standard Maven directory for the compiled classes? This shouldn't
prevent you from hot deploying changes...

2) Have you configured your desired output directory in your pom.xml so that Maven compiles
your classes to the same directory?


3) If you really need to compile to WEB-INF/classes, have you tried configuring the Maven
WAR plugin to exclude that directory when packaging web resources? See [1]




To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message