Thanks for the reply!
1) When I left the eclipse output directory as target MyEclipse got very
confused and I had a lot of issues, especially switching between eclipse and
maven builds.
2) No, I have not changed the maven output directories. This still goes to
the default target directories. We're keeping the "built by maven" output
(target/classes and target/test-classes) and the "built by eclipse"
(src/main/webapp/WEB-INF/classes) separate.
3) Yes, I have tried to get the exclude to work for the web resources, but
with no success. All examples are for additional web resource folder, so I
wonder if that's got anything to do with it. (??) Has anyone had any
experience excluding files / directories from src/main/webapp?
Here are some of the things that I have tried, none of which work. :-(
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.0</version>
<configuration>
<!--
<excludes>
<exclude>**/WEB-INF/classes/**</exclude>
</excludes>
-->
<!--
<webResources>
<resource>
<directory>src/main/webapp/</directory>
<excludes>
<exclude>**/WEB-INF/classes/**</exclude>
</excludes>
</resource>
</webResources>
-->
<webResources>
<resource>
<directory>
src/main/webapp/WEB-INF/classes/
</directory>
<excludes>
<exclude>**</exclude>
</excludes>
</resource>
</webResources>
</configuration>
</plugin>
Thanks for all your time and help!
Jim
On 9/10/07, Thorsten Heit <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> > 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 *Test.java 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?
>
> <build>
> ...
> <outputDirectory>...</outputDirectory>
> <testOutputDirectory>...</testOutputDirectory>
> </build>
>
> 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]
>
>
> [1]
> http://maven.apache.org/plugins/maven-war-plugin/faq.html#webresourcesexclude
>
>
> Regards
>
> Thorsten
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>