Considerare un genitore testCycle
con i moduli DummyCore
e TestFramework
.Posso evitare un ciclo di dipendenze con un fronte che è una dipendenza di test?
TestFramework
dipende DummyCore
, e DummyCore
ha un dedepency test TestFramework
.
Costruire e testare ogni modulo in modo indipendente non ha alcun problema. Ma mvn test
dei genitori testCycle
risultati 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
di riprodursi:
wget http://dp4j.sf.net/debug/testCycle.zip
unzip testCycle.zip
cd testCycle; mvn test
La mia aspettativa era che Maven avrebbe costruito DummyCore
src e poi venire a compilare i test compilerà TestFramework
src, che non lo fa dipende da DummyCore
. A questo punto avrebbe compilato DummyCore
src + test e TestFramework
src. Finalmente compilerà anche i test DummyCore
. C'è un modo per dire a Maven di fare questo? Se no, come faresti a risolvere questo?
Spostare il tests
in DummyCore
in un modulo a sé stante che dipende DummyCore
e TestFramework
? Lo farei solo per soddisfare le persone.
Nella mia esperienza, le dipendenze cicliche gridano sempre che c'è un problema con il design. Non importa se il ciclo è in un barattolo, un pacchetto o una classe. – Augusto
@Augusto amen a quello –