title: How to test single test modules in intellij in maven project having test dependency?
body: <p>Here is the situation :</p>
  
  <p>I have 2 modules, module KID that depends on module PARENT.
  I have a test class in PARENT that can be used in KID to test the implementation of a class.</p>
  
  <p>To do so, I added a the following dependency :</p>
  
  <pre><code>    &lt;dependency&gt;
          &lt;groupId&gt;myGroup&lt;/groupId&gt;
          &lt;artifactId&gt;PARENT&lt;/artifactId&gt;
          &lt;version&gt;${project.version}&lt;/version&gt;
          &lt;type&gt;test-jar&lt;/type&gt;
          &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
  </code></pre>
  
  <p>With maven, the tests are running fine.</p>
  
  <p>With Intellij, (right click on the java test folder + run 'All tests' for KID), I get a NoClassDefFoundError. The problem is that tests from both modules are running, but it is only using the dependencies of the kid.</p>
  
  <p>In the project PARENT I have a dependency that I don't need in KID :</p>
  
  <pre><code>    &lt;dependency&gt;
          &lt;groupId&gt;commons-codec&lt;/groupId&gt;
          &lt;artifactId&gt;commons-codec&lt;/artifactId&gt;
          &lt;version&gt;1.8&lt;/version&gt;
          &lt;scope&gt;provided&lt;/scope&gt;
      &lt;/dependency&gt;
  </code></pre>
  
  <p>Setting the scopes to provided instead of test will fix my problem, but it allow the main code to use test code.</p>
  
  <p>I might have missed something ? This is a bug ? </p>