You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Giovanni Azua <br...@swissonline.ch> on 2009/03/25 11:31:49 UTC

tricky cyclic dependency issue ...

hi,

I have the following setup:

ProjectX-API: pure abstract layer (depends on TestCommon)
ProjectX-Core: main implementations (depends on API and transitively on
TestCommon)

ProjectX-TestCommon: offers common testing facilities to all ProjectX
sub-modules, but also to clients of ProjectX and it also acts as single
entry point for all test-scoped dependencies e.g. JUnit 4.x

Now the problem is that while I need TestCommon for implementing the test
suites in API and Core modules, TestCommon needs to depend on API and
eventually on the Core module too.

e.g. 

ProjectX-TestCommon defines a reusable AbstractTestSingleton to test
Singleton types. ProjectX-API defines the ISingleton abstraction and also
defines some concrete Singleton instances.

AbstractTestSingleton that resides in ProjectX-TestCommon needs to depend on
ProjectX-API and JUnit 4.x at the same time. 

Possibilities:

- Moving AbstractTestSingleton to ProjectX-API is not possible because
ProjectX-API should not depend on anything else, especially not on JUnit 4.x
that AbstractTestSingleton requires (it extends TestCase)

- Having module ProjectX-TestCommon depend on ProjectX-API does not work
because ProjectX-API already depends on ProjectX-TestCommon (to test the
concrete Singletons and more) and Maven reports a cyclic dependency. I tried
many alternatives e.g. exclusion (excluding ProjectX-API when ProjectX-API
declares dependency on ProjectX-TestCommon), changing scope to provided,
etc.

Any other ideas how to resolve this?

TIA,
Best regards,
Giovanni



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