You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by "Iordanov, Borislav (CIAO)" <bo...@miamidade.gov> on 2012/05/09 07:51:26 UTC

circular dependency with common test classes

Hi,

I'm a relatively new Maven user. I found an exact description of my problem on StackOverflow, but no solution:

http://stackoverflow.com/questions/10174542/resolving-maven-circular-dependencies-between-test-testhelper-and-project-unde

One can easily get around the problem by first building the core project with -Dmaven.test.skip=true. But the Eclipse plugin is not so smart and I can't load my projects in Eclipse. 

I think this a legitimate case that Maven should be able to solve on its own since the common test classes (Atesthelper in the StackOverflow post) are declared as a test scope dependency.

Is there any solution available for this problem (splitting the main project in two is not an option, and it would be a terrible hack just to satisfy a Maven limitation)? Any plugin or configuration trick?

Thanks much in advance!
Boris

Re: circular dependency with common test classes

Posted by Barrie Treloar <ba...@gmail.com>.
On Wed, May 9, 2012 at 6:38 PM, Stephen Connolly
<st...@gmail.com> wrote:
[del]
> You need to keep in mind the way the lifecycle works, i.e. that the
> lifecycle is completed on each module before moving onto the next, so
> even though the requirements of the test phase could be satisfied if
> *all* modules are finished the compile phase, you will never have that
> case.

I suggest you read the freely available books at
http://maven.apache.org/articles.html they will help you with the
learning curve.

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


Re: circular dependency with common test classes

Posted by Stephen Connolly <st...@gmail.com>.
On 9 May 2012 06:51, Iordanov, Borislav (CIAO) <bo...@miamidade.gov> wrote:
> Hi,
>
> I'm a relatively new Maven user. I found an exact description of my problem on StackOverflow, but no solution:
>
> http://stackoverflow.com/questions/10174542/resolving-maven-circular-dependencies-between-test-testhelper-and-project-unde
>
> One can easily get around the problem by first building the core project with -Dmaven.test.skip=true. But the Eclipse plugin is not so smart and I can't load my projects in Eclipse.
>
> I think this a legitimate case that Maven should be able to solve on its own since the common test classes (Atesthelper in the StackOverflow post) are declared as a test scope dependency.
>
> Is there any solution available for this problem (splitting the main project in two is not an option, and it would be a terrible hack just to satisfy a Maven limitation)? Any plugin or configuration trick?

The solution is to put A_t in a separate module that just has tests,
breaking the circle.

You need to keep in mind the way the lifecycle works, i.e. that the
lifecycle is completed on each module before moving onto the next, so
even though the requirements of the test phase could be satisfied if
*all* modules are finished the compile phase, you will never have that
case.

>
> Thanks much in advance!
> Boris

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