title: Maven.surefire.util.SurefireReflectionException When testing Junit tests
body: <p>I'm running a batch little python script that auto grades a bunch of java programs by running all of their Junit tests. I take the exported eclipse projects, unzip them, then call maven to run the tests. I haven't changed anything from the original eclipse projects, and the tests run fine in eclipse.</p>
  
  <p>This is my first real time using Maven.</p>
  
  <p>For reference, I'm running on Windows 10, and my paths are all set correctly, and they match what's happening in Eclipse, I believe.</p>
  
  <pre><code>Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-
  
  10T11:41:47-05:00)
  Maven home: C:\Program Files\Apache\apache-maven-3.3.9
  Java version: 1.8.0_111, vendor: Oracle Corporation
  Java home: C:\Program Files\Java\jdk1.8.0_111\jre
  Default locale: en_US, platform encoding: Cp1252
  OS name: "windows 10", version: "10.0", arch: "amd64", family: "dos"
  </code></pre>
  
  <p><strong>I've gotten the following error:</strong></p>
  
  <pre><code>-------------------------------------------------------
   T E S T S
  -------------------------------------------------------
  org.apache.maven.surefire.util.SurefireReflectionException: java.lang.reflect.InvocationTargetException; nested exception is java.lang.reflect.InvocationTargetException: null
  java.lang.reflect.InvocationTargetException
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:498)
      at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
      at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
      at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
      at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
      at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)
  Caused by: java.lang.NoClassDefFoundError: edu/brandeis/cs12b/PA7/PA7/target/test-classes/edu/brandeis/cs12b/PA7/KnowledgeBaseTest (wrong name: edu/brandeis/cs12b/PA7/KnowledgeBaseTest)
      at java.lang.ClassLoader.defineClass1(Native Method)
      at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
      at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
      at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
      at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
      at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
      at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
      at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
      at org.apache.maven.surefire.util.DefaultScanResult.loadClass(DefaultScanResult.java:131)
      at org.apache.maven.surefire.util.DefaultScanResult.applyFilter(DefaultScanResult.java:95)
      at org.apache.maven.surefire.junit4.JUnit4Provider.scanClassPath(JUnit4Provider.java:194)
      at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:92)
      ... 9 more
  
  Results :
  
  Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
  </code></pre>
  
  <p><strong>Here's a copy of the POM file:</strong></p>
  
  <pre><code>&lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"&gt;
      &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  
      &lt;groupId&gt;edu.brandeis.cs12b.pa7&lt;/groupId&gt;
      &lt;artifactId&gt;PA7&lt;/artifactId&gt;
      &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
      &lt;packaging&gt;jar&lt;/packaging&gt;
  
      &lt;name&gt;PA7&lt;/name&gt;
      &lt;url&gt;http://maven.apache.org&lt;/url&gt;
  
      &lt;properties&gt;
          &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
      &lt;/properties&gt;
  
      &lt;build&gt;
          &lt;plugins&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                  &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
                  &lt;version&gt;3.3&lt;/version&gt;
                  &lt;configuration&gt;
                      &lt;source&gt;1.8&lt;/source&gt;
                      &lt;target&gt;1.8&lt;/target&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
          &lt;/plugins&gt;
      &lt;/build&gt;
  
      &lt;dependencies&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;junit&lt;/groupId&gt;
              &lt;artifactId&gt;junit&lt;/artifactId&gt;
              &lt;version&gt;4.11&lt;/version&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
  
      &lt;/dependencies&gt;
  &lt;/project&gt;
  </code></pre>