Consider a testCycle
parent with modules DummyCore
and TestFramework
.
TestFramework
depends on DummyCore
, and DummyCore
has a test dedepency on TestFramework
.
Building and testing each module independently maven has no problems. But mvn test
the parents testCycle
results in:
The projects in the reactor contain a cyclic reference: Edge between 'Vertex{label='com.mysimpatico:TestFramework:1.0-SNAPSHOT'}' and 'Vertex{label='org.apache:DummyCore:1.0-SNAPSHOT'}' introduces to cycle in the graph org.apache:DummyCore:1.0-SNAPSHOT --> com.mysimpatico:TestFramework:1.0-SNAPSHOT --> org.apache:DummyCore:1.0-SNAPSHOT -> [Help 1]
To see the full stack trace of the errors, re-run Maven with the -e switch.
Re-run Maven using the -X switch to enable full debug logging.
For more information about the errors and possible solutions, please read the following articles:
[Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectCycleException
To reproduce:
wget http://dp4j.sf.net/debug/testCycle.zip
unzip testCycle.zip
cd testCycle; mvn test
My expectation was that maven would build DummyCore
src and then coming to compile the tests will compile TestFramework
src, which doesn't depend on DummyCore
. At this stage it would have compiled DummyCore
src + tests, and TestFramework
src. Finally it will compile DummyCore
tests too. Is there a way to tell maven to do this?
If not, how would you work around this?
Move the tests
in DummyCore
into a module of its own that depends on DummyCore
and TestFramework
? I'd be doing that just to satisfy maven.