Note that there are some explanatory texts on larger screens.

plurals
  1. POCan I avoid a dependency cycle with one edge being a test dependency?
    primarykey
    data
    text
    <p>Consider a <code>testCycle</code> parent with modules <code>DummyCore</code> and <code>TestFramework</code>. </p> <p><code>TestFramework</code> depends on <code>DummyCore</code>, and <code>DummyCore</code> has a test dedepency on <code>TestFramework</code>. </p> <p>Building and testing each module independently maven has no problems. But <code>mvn test</code> the parents <code>testCycle</code> results in:</p> <pre><code> 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 --&gt; com.mysimpatico:TestFramework:1.0-SNAPSHOT --&gt; org.apache:DummyCore:1.0-SNAPSHOT -&gt; [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 </code></pre> <p>To reproduce:</p> <pre><code>wget http://dp4j.sf.net/debug/testCycle.zip unzip testCycle.zip cd testCycle; mvn test </code></pre> <p>My expectation was that maven would build <code>DummyCore</code> src and then coming to compile the tests will compile <code>TestFramework</code> src, which doesn't depend on <code>DummyCore</code>. At this stage it would have compiled <code>DummyCore</code> src + tests, and <code>TestFramework</code> src. Finally it will compile <code>DummyCore</code> tests too. Is there a way to tell maven to do this? If not, how would you work around this? </p> <p>Move the <code>tests</code> in <code>DummyCore</code> into a module of its own that depends on <code>DummyCore</code> and <code>TestFramework</code>? I'd be doing that just to satisfy maven.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload