You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Dave Rathnow <Da...@umsltd.com> on 2007/03/09 17:11:52 UTC

How do I share test classes between projects?

 

I'm new to Maven and have been working with if for a few days.  I've
been reading

through the documentation but haven't found the answer to this question.

 

I have two projects A and B with testing classes in both.  The test
classes in B

Inherit from classes in A and they also use fixtures from A as well.  I
have setup

a dependency with project A in project B but since the test classes are
not installed

with project A in my local repository, B will not build.

 

Is there a way to do this with Maven or do I have to change the way I've
setup

my test framework?  That is, is there an easy way to share test classes
between

projects with Maven?

 

Thanks,
Dave.


Re: How do I share test classes between projects?

Posted by Dan Tran <da...@gmail.com>.
move your common test classes to another project but place them in main
source ( ie src/main/java)

other project can refencence it via dependency mechanism to run the test

-D


On 3/9/07, Dave Rathnow <Da...@umsltd.com> wrote:
>
>
>
> I'm new to Maven and have been working with if for a few days.  I've
> been reading
>
> through the documentation but haven't found the answer to this question.
>
>
>
> I have two projects A and B with testing classes in both.  The test
> classes in B
>
> Inherit from classes in A and they also use fixtures from A as well.  I
> have setup
>
> a dependency with project A in project B but since the test classes are
> not installed
>
> with project A in my local repository, B will not build.
>
>
>
> Is there a way to do this with Maven or do I have to change the way I've
> setup
>
> my test framework?  That is, is there an easy way to share test classes
> between
>
> projects with Maven?
>
>
>
> Thanks,
> Dave.
>
>

Re: How do I share test classes between projects?

Posted by Wayne Fay <wa...@gmail.com>.
You need to use type "test-jar":
http://maven.apache.org/guides/mini/guide-attached-tests.html

Wayne

On 3/9/07, Dave Rathnow <Da...@umsltd.com> wrote:
>
>
> I'm new to Maven and have been working with if for a few days.  I've
> been reading
>
> through the documentation but haven't found the answer to this question.
>
>
>
> I have two projects A and B with testing classes in both.  The test
> classes in B
>
> Inherit from classes in A and they also use fixtures from A as well.  I
> have setup
>
> a dependency with project A in project B but since the test classes are
> not installed
>
> with project A in my local repository, B will not build.
>
>
>
> Is there a way to do this with Maven or do I have to change the way I've
> setup
>
> my test framework?  That is, is there an easy way to share test classes
> between
>
> projects with Maven?
>
>
>
> Thanks,
> Dave.
>
>

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