Andreas, thank you for the reply.

Your answer lead me find that my problem has been with my project setup in
Eclipse rather than anything to do with Maven. The test-classes where being
compiled into the target/classes directory instead of target/test-classes

Thanks again.



Andreas G Guther wrote:
> 
> If you follow the standard layout with production code under src/main
> and test classes under src/test than you test classes will be excluded
> from the resulting artifact automatically.
> 
> But maybe I am misreading your email. Do you want to create a binary
> containing the source (.java) files or are you talking about the binary
> used for production?
> 
> However if you need multiple output than you might want to look at the
> assembly plug-in which allow you to define a distribution that might
> contain a jar file with binaries, a jar file with javadoc, etc.
> 
> Andreas
> 
> 
> 
> 
> -----Original Message-----
> From: Tomek Korzeniewski [mailto:[EMAIL PROTECTED] 
> Sent: Saturday, November 04, 2006 11:19 AM
> To: [email protected]
> Subject: Exclude tests from packaged artifact
> 
> 
> Hello,
> 
> What is the easiest way to prevent tests being packaged together with
> source
> files in the resulting artifact package?
> 
> I would like the tests to execute, but be packaged in a seperate jar.
> Currently I have configured the maven-jar-plugin as follows: 
> 
> <plugin>
>  <groupId>org.apache.maven.plugins</groupId>
>       <artifactId>maven-jar-plugin</artifactId>
>             <executions>
>               <execution>
>                  <goals>
>                       <goal>test-jar</goal>
>                 </goals>
>               </execution>
>            </executions>
>       </plugin>
> So this creates the tests packaged on their own , however they are still
> included in the generted package.
> 
> Is there some way I can exclude the test-classes directory from being
> packaged? 
> 
> -- 
> View this message in context:
> http://www.nabble.com/Exclude-tests-from-packaged-artifact-tf2574864s177
> .html#a7177951
> Sent from the Maven - Users mailing list archive at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Exclude-tests-from-packaged-artifact-tf2574864s177.html#a7183997
Sent from the Maven - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to