This may be out of scope for this question, but why not use m2eclipse?
It separates main and test classes nicely and IMHO relieves you from all of 
these problems.

Best regards,
Eric 

> -----Ursprüngliche Nachricht-----
> Von: Deron Eriksson [mailto:jonde...@codestrategies.com] 
> Gesendet: Montag, 19. Januar 2009 14:18
> An: users@maven.apache.org
> Betreff: Re: how to exclude classes from package in 
> target/classes to be copied to WAR in packaging
> 
> 
> If Eclipse is automatically generating classes in 
> target/classes from your
> classes in src/test/java, I think there is a problem, since 
> src/test/java
> classes should end up in target/test-classes. I would recommend
>  
> (1) running eclipse:eclipse on your project (to update your Eclipse
> .classpath) and then
> (2) perform a clean (to clean out the old files in target/classes).
>  
> As an example, if I execute 'mvn eclipse:eclipse' on a web 
> project of mine,
> my Eclipse project .classpath file ends up with the following:
> ...
>   <classpathentry kind="src" path="src/main/java"/>
>   <classpathentry kind="src" path="src/test/java"
> output="target/test-classes"/>
>   <classpathentry kind="output" path="target/classes"/>
> ...
>  
> Notice that src/test/java classes go to target/test-classes.
>  
> After performing eclipse:eclipse and refreshing your project, your
> .classpath should be similar to the above.
>  
> After this, you should perform a 'mvn clean' and refresh your 
> project. You
> should end up with 
>  target/classes (empty folder)
>  target/test-classes (empty folder)
>  
> Now, if you perform a 'mvn clean package', you should see 
> that your regular
> classes end up in target/classes and your test classes end up in
> target/test-classes. If you inspect your war file that is created, you
> should see that it does not contain your test classes.
>   
> Deron Eriksson
> 
> -- 
> View this message in context: 
> http://www.nabble.com/how-to-exclude-classes-from-package-in-t
> arget-classes-to-be-copied-to-WAR-in-packaging-tp21540465p2154
> 2863.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
> For additional commands, e-mail: users-h...@maven.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org

Reply via email to