Move the concrete impls of your API interfaces into a seperate module.
The only solution to cyclical dependencies is not to have them.
Justin
On Mar 25, 2009, at 8:21 AM, "Giovanni Azua" <brave...@hotmail.com>
wrote:
hi,
I have the following setup:
ProjectX-API: pure abstract layer (depends on TestCommon at test
scope)
ProjectX-Core: main implementations (depends on API and also on
TestCommon at test scope)
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-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org