¿Puedo evitar un ciclo de dependencia con un borde como una dependencia de prueba?
Considerar untestCycle
padre con módulosDummyCore
yTestFramework
.
TestFramework
depende deDummyCore
yDummyCore
tiene una dependencia de prueba enTestFramework
.
Construir y probar cada módulo de forma independiente maven no tiene problemas. Peromvn test
los padrestestCycle
resulta en:
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
Reproducir
wget http://dp4j.sf.net/debug/testCycle.zip
unzip testCycle.zip
cd testCycle; mvn test
Mi expectativa era que Maven construiríaDummyCore
src y luego compilando las pruebas compilaráTestFramework
src, que no depende deDummyCore
. En esta etapa, habría compiladoDummyCore
src + pruebas yTestFramework
src. Finalmente compilaráDummyCore
pruebas también. ¿Hay alguna manera de decirle a Maven que haga esto? Si no, ¿cómo solucionaría esto?
Mueve eltests
inDummyCore
en un módulo propio que depende deDummyCore
yTestFramework
? Lo estaría haciendo solo para satisfacer a Maven.