You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by "sean chen(陈思淼)" <ch...@gmail.com> on 2008/10/15 03:34:43 UTC

How to subproject dependency including test-class?

I have 3 sub-projects, the structure is like this:MyProject-all
-----common
----------client
----------server

the client and server depend on the common project, the src/main/java depend
on common is Good. but when I have some base test class in the
common-project. when I try to extend it in the client-project, the mvn pops
compile exception but it's good in the eclipse project.
I think the maven project dependence just exclude the test-class,

I know I can make a common-test-project which depends on all the other
project to solve this problem, but that not good to be. Is there other
resolutions? please tell me.

Re: How to subproject dependency including test-class?

Posted by "sean chen(陈思淼)" <ch...@gmail.com>.
OK ,have move the BaseTestCase to the src/main/java 's test package .Thanks
Wayne.

2008/10/15 Wayne Fay <wa...@gmail.com>

> Either move the base test class out of src/test/java and into
> src/main/java, or use the test-jar approach:
> http://maven.apache.org/guides/mini/guide-attached-tests.html
>
> Wayne
>
> On Tue, Oct 14, 2008 at 6:34 PM, sean chen(陈思淼) <ch...@gmail.com>
> wrote:
> > I have 3 sub-projects, the structure is like this:MyProject-all
> > -----common
> > ----------client
> > ----------server
> >
> > the client and server depend on the common project, the src/main/java
> depend
> > on common is Good. but when I have some base test class in the
> > common-project. when I try to extend it in the client-project, the mvn
> pops
> > compile exception but it's good in the eclipse project.
> > I think the maven project dependence just exclude the test-class,
> >
> > I know I can make a common-test-project which depends on all the other
> > project to solve this problem, but that not good to be. Is there other
> > resolutions? please tell me.
> >
>

Re: How to subproject dependency including test-class?

Posted by Wayne Fay <wa...@gmail.com>.
Either move the base test class out of src/test/java and into
src/main/java, or use the test-jar approach:
http://maven.apache.org/guides/mini/guide-attached-tests.html

Wayne

On Tue, Oct 14, 2008 at 6:34 PM, sean chen(陈思淼) <ch...@gmail.com> wrote:
> I have 3 sub-projects, the structure is like this:MyProject-all
> -----common
> ----------client
> ----------server
>
> the client and server depend on the common project, the src/main/java depend
> on common is Good. but when I have some base test class in the
> common-project. when I try to extend it in the client-project, the mvn pops
> compile exception but it's good in the eclipse project.
> I think the maven project dependence just exclude the test-class,
>
> I know I can make a common-test-project which depends on all the other
> project to solve this problem, but that not good to be. Is there other
> resolutions? please tell me.
>