You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Morgan Fletcher <mo...@modius.com> on 2008/05/20 23:04:39 UTC

How to include junit tests in a generated jar, using maven 1.1?

I have a maven 1.1 project. I need to create a new goal which will
generate the jar including junit test classes. I am not quite sure how
to do it. Can I get a hint?

 

Thanks,


Morgan


RE: How to include junit tests in a generated jar, using maven 1.1?

Posted by Morgan Fletcher <mo...@modius.com>.
> I suggest adding a custom goal maven.xml that adds the test classes
dir to
> the list of source dirs, then creates the jar.

Thanks. I ended up adding this goal, which produces a separate test jar:

   <goal name="test-build">
     <attainGoal name="test:compile"/>
     <ant:jar destfile="./target/Module-test-${pom.currentVersion}.jar"
         basedir="target/test-classes"
         includes="**/**"/>
   </goal>

I had to add this to <project> as well:

xmlns:ant="jelly:ant"

Morgan 

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


RE: How to include junit tests in a generated jar, using maven 1.1?

Posted by Jeff Jensen <je...@upstairstechnology.com>.
I suggest adding a custom goal maven.xml that adds the test classes dir to
the list of source dirs, then creates the jar.

Start here, and there are links to other pages (especially the submenu
pages).
http://maven.apache.org/maven-1.x/using/customising.html



-----Original Message-----
From: Morgan Fletcher [mailto:morgan.fletcher@modius.com] 
Sent: Tuesday, May 20, 2008 4:05 PM
To: users@maven.apache.org
Subject: How to include junit tests in a generated jar, using maven 1.1?

I have a maven 1.1 project. I need to create a new goal which will
generate the jar including junit test classes. I am not quite sure how
to do it. Can I get a hint?

 

Thanks,


Morgan



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