title: junit not respecting maven classpath
body: <p>Environment:<br/>
  Eclipse Juno <br />
  Junit 4.11 <br/>
  maven 3.0.4<br/></p>
  
  <p>Problem:</p>
  
  <p>
  I believe i have a classloading problem when running a unit test in eclipse's junit runner.
  My Specific problem stems from this code: </p>
  
  <pre><code>this.getClass().forName(type);
  </code></pre>
  
  <p><p>
  The above code will get called eventually with the name of a class that lives in an maven dependency (The dependency is simply a collection of java beans).
  When i run a mvn test this code runs successfully, however if i use eclipse to run the junit tests i receive a class not found exception.
  </p><p>
  The classpath entry found in the classpath tab of the run configuration references the maven dependencies. So i'm not sure why the dependency isn't being pulled in. 
  </p></p>
  
  <p>Why would this be happening? I have the maven plugin installed in eclipse, so it should be using the same classpath.  Yet it seems that not everything is identical. I've tried doing cleans, updating maven project configuration and restarting eclipse.</p>
  
  <p>.classpath file</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;classpath&gt;
      &lt;classpathentry kind="src" output="target/classes" path="src/main/java"&gt;
          &lt;attributes&gt;
              &lt;attribute name="optional" value="true"/&gt;
              &lt;attribute name="maven.pomderived" value="true"/&gt;
          &lt;/attributes&gt;
      &lt;/classpathentry&gt;
      &lt;classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"&gt;
          &lt;attributes&gt;
              &lt;attribute name="maven.pomderived" value="true"/&gt;
          &lt;/attributes&gt;
      &lt;/classpathentry&gt;
      &lt;classpathentry kind="src" output="target/test-classes" path="src/test/java"&gt;
          &lt;attributes&gt;
              &lt;attribute name="optional" value="true"/&gt;
              &lt;attribute name="maven.pomderived" value="true"/&gt;
          &lt;/attributes&gt;
      &lt;/classpathentry&gt;
      &lt;classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources"&gt;
          &lt;attributes&gt;
              &lt;attribute name="maven.pomderived" value="true"/&gt;
          &lt;/attributes&gt;
      &lt;/classpathentry&gt;
      &lt;classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"&gt;
          &lt;attributes&gt;
              &lt;attribute name="maven.pomderived" value="true"/&gt;
          &lt;/attributes&gt;
      &lt;/classpathentry&gt;
      &lt;classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER"&gt;
          &lt;attributes&gt;
              &lt;attribute name="maven.pomderived" value="true"/&gt;
          &lt;/attributes&gt;
      &lt;/classpathentry&gt;
      &lt;classpathentry kind="output" path="target/classes"/&gt;
  &lt;/classpath&gt;
  </code></pre>
  
  <p>.project file</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;projectDescription&gt;
      &lt;name&gt;brokenClasspathproject&lt;/name&gt;
      &lt;comment&gt;&lt;/comment&gt;
      &lt;projects&gt;
      &lt;/projects&gt;
      &lt;buildSpec&gt;
          &lt;buildCommand&gt;
              &lt;name&gt;org.eclipse.wst.common.project.facet.core.builder&lt;/name&gt;
              &lt;arguments&gt;
              &lt;/arguments&gt;
          &lt;/buildCommand&gt;
          &lt;buildCommand&gt;
              &lt;name&gt;org.eclipse.jdt.core.javabuilder&lt;/name&gt;
              &lt;arguments&gt;
              &lt;/arguments&gt;
          &lt;/buildCommand&gt;
          &lt;buildCommand&gt;
              &lt;name&gt;org.eclipse.m2e.core.maven2Builder&lt;/name&gt;
              &lt;arguments&gt;
              &lt;/arguments&gt;
          &lt;/buildCommand&gt;
      &lt;/buildSpec&gt;
      &lt;natures&gt;
          &lt;nature&gt;org.eclipse.jdt.core.javanature&lt;/nature&gt;
          &lt;nature&gt;org.eclipse.m2e.core.maven2Nature&lt;/nature&gt;
          &lt;nature&gt;org.eclipse.wst.common.project.facet.core.nature&lt;/nature&gt;
      &lt;/natures&gt;
  &lt;/projectDescription&gt;
  </code></pre>
  
  <p><br/> junit config</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8" standalone="no"?&gt;
  &lt;launchConfiguration type="org.eclipse.jdt.junit.launchconfig"&gt;
  &lt;stringAttribute key="bad_container_name" value="/brokenClasspathproject/junit"/&gt;
  &lt;listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS"&gt;
  &lt;listEntry value="/brokenClasspathproject"/&gt;
  &lt;/listAttribute&gt;
  &lt;listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES"&gt;
  &lt;listEntry value="4"/&gt;
  &lt;/listAttribute&gt;
  &lt;stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value="=brokenClasspathproject"/&gt;
  &lt;booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/&gt;
  &lt;stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/&gt;
  &lt;stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit4"/&gt;
  &lt;stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="org.eclipse.m2e.launchconfig.classpathProvider"/&gt;
  &lt;stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value=""/&gt;
  &lt;stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="brokenClasspathproject"/&gt;
  &lt;stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.m2e.launchconfig.sourcepathProvider"/&gt;
  &lt;/launchConfiguration&gt;
  </code></pre>