title: How can I reference unit test classes of a maven dependency in my java project?
body: <p>I need to reference some JUnit Tests (src/test/java) from project B in the test package src/test/java of project A whereas B is a maven dependecy of A.</p>
  
  <p>Is this even possible?</p>
  
  <pre><code>&lt;dependency&gt;
      &lt;groupId&gt;XYZ&lt;/groupId&gt;
      &lt;artifactId&gt;B&lt;/artifactId&gt;
      &lt;version&gt;${project.version}&lt;/version&gt;
      &lt;type&gt;jar&lt;/type&gt;
      &lt;scope&gt;test&lt;/scope&gt;
  &lt;/dependency&gt; 
  </code></pre>
  
  <p>Both projects are under my controll.</p>
  
  <p>Thanks for your advice</p>