title: org.apache.maven.surefire.util.SurefireReflectionException when i run a maven project in eclipse
body: <p>this is first time i use Maven in eclipse with selenium.
  So i use the example of Mkyong : <a href="http://www.mkyong.com/maven/how-to-create-a-java-project-with-maven/" rel="nofollow">http://www.mkyong.com/maven/how-to-create-a-java-project-with-maven/</a>
  and i replace the AppTest.java by a simple gmail login test.</p>
  
  <p>So my pom.xml is:</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/maven-v4_0_0.xsd"&gt;
      &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
      &lt;groupId&gt;com.mkyong&lt;/groupId&gt;
      &lt;artifactId&gt;NumberGenerator&lt;/artifactId&gt;
      &lt;packaging&gt;jar&lt;/packaging&gt;
      &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
      &lt;name&gt;NumberGenerator&lt;/name&gt;
      &lt;url&gt;http://maven.apache.org&lt;/url&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;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;2.3.2&lt;/version&gt;
                  &lt;configuration&gt;
                      &lt;source&gt;1.6&lt;/source&gt;
                      &lt;target&gt;1.6&lt;/target&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
          &lt;/plugins&gt;
      &lt;/build&gt;
  
  &lt;/project&gt;
  </code></pre>
  
  <p>My AppTest.java is:</p>
  
  <pre><code>package com.mkyong;
  
  import java.util.regex.Pattern;
  import java.util.concurrent.TimeUnit;
  
  import org.junit.*;
  
  import static org.junit.Assert.*;
  import static org.hamcrest.CoreMatchers.*;
  
  import org.openqa.selenium.*;
  import org.openqa.selenium.chrome.ChromeDriver;
  import org.openqa.selenium.firefox.FirefoxDriver;
  import org.openqa.selenium.support.ui.Select;
  
  public class AppTest {
    private WebDriver driver;
    private String baseUrl;
    private boolean acceptNextAlert = true;
    private StringBuffer verificationErrors = new StringBuffer();
  
    @Before
    public void setUp() throws Exception {
      //driver = new FirefoxDriver();
      driver = new ChromeDriver();
      baseUrl = "https://accounts.google.com/";
      driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
    }
  
    @Test
    public void testGmail() throws Exception {
      driver.get("http://www.gmail.com");
      driver.findElement(By.id("Email")).clear();
      driver.findElement(By.id("Email")).sendKeys("emailaddress");
      driver.findElement(By.id("Passwd")).clear();
      driver.findElement(By.id("Passwd")).sendKeys("password");
      driver.findElement(By.id("signIn")).click();
      /*driver.findElement(By.cssSelector("span.gb_4.gbii")).click();
      driver.findElement(By.id("gb_71")).click();*/
    }
  
    @After
    public void tearDown() throws Exception {
      driver.quit();
      String verificationErrorString = verificationErrors.toString();
      if (!"".equals(verificationErrorString)) {
        fail(verificationErrorString);
      }
    }
  
    private boolean isElementPresent(By by) {
      try {
        driver.findElement(by);
        return true;
      } catch (NoSuchElementException e) {
        return false;
      }
    }
  
    private boolean isAlertPresent() {
      try {
        driver.switchTo().alert();
        return true;
      } catch (NoAlertPresentException e) {
        return false;
      }
    }
  
    private String closeAlertAndGetItsText() {
      try {
        Alert alert = driver.switchTo().alert();
        String alertText = alert.getText();
        if (acceptNextAlert) {
          alert.accept();
        } else {
          alert.dismiss();
        }
        return alertText;
      } finally {
        acceptNextAlert = true;
      }
    }
  }
  </code></pre>
  
  <p>When i run by right-clicking the project and click on maven-install, i receive the following error as result:</p>
  
  <pre><code>[INFO] Scanning for projects...
  [INFO] 
  [INFO] Using the builder org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder with a thread count of 1
  [INFO]                                                                         
  [INFO] ------------------------------------------------------------------------
  [INFO] Building NumberGenerator 1.0-SNAPSHOT
  [INFO] ------------------------------------------------------------------------
  [INFO] 
  [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ NumberGenerator ---
  [WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
  [INFO] skip non existing resourceDirectory C:\Users\Thimo\Downloads\Maven-NumberGenerator\NumberGenerator\src\main\resources
  [INFO] 
  [INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ NumberGenerator ---
  [INFO] Nothing to compile - all classes are up to date
  [INFO] 
  [INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ NumberGenerator ---
  [WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
  [INFO] skip non existing resourceDirectory C:\Users\Thimo\Downloads\Maven-NumberGenerator\NumberGenerator\src\test\resources
  [INFO] 
  [INFO] --- maven-compiler-plugin:2.3.2:testCompile (default-testCompile) @ NumberGenerator ---
  [INFO] Nothing to compile - all classes are up to date
  [INFO] 
  [INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ NumberGenerator ---
  [INFO] Surefire report directory: C:\Users\Thimo\Downloads\Maven-NumberGenerator\NumberGenerator\target\surefire-reports
  
  -------------------------------------------------------
   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(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      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: org/openqa/selenium/NoSuchElementException
      at java.lang.Class.getDeclaredMethods0(Native Method)
      at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
      at java.lang.Class.privateGetMethodRecursive(Unknown Source)
      at java.lang.Class.getMethod0(Unknown Source)
      at java.lang.Class.getMethod(Unknown Source)
      at org.apache.maven.surefire.util.ReflectionUtils.tryGetMethod(ReflectionUtils.java:57)
      at org.apache.maven.surefire.common.junit3.JUnit3TestChecker.isSuiteOnly(JUnit3TestChecker.java:64)
      at org.apache.maven.surefire.common.junit3.JUnit3TestChecker.isValidJUnit3Test(JUnit3TestChecker.java:59)
      at org.apache.maven.surefire.common.junit3.JUnit3TestChecker.accept(JUnit3TestChecker.java:54)
      at org.apache.maven.surefire.common.junit4.JUnit4TestChecker.accept(JUnit4TestChecker.java:51)
      at org.apache.maven.surefire.util.DefaultScanResult.applyFilter(DefaultScanResult.java:97)
      at org.apache.maven.surefire.junit4.JUnit4Provider.scanClassPath(JUnit4Provider.java:194)
      at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:92)
      ... 9 more
  Caused by: java.lang.ClassNotFoundException: org.openqa.selenium.NoSuchElementException
      at java.net.URLClassLoader$1.run(Unknown Source)
      at java.net.URLClassLoader$1.run(Unknown Source)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(Unknown Source)
      at java.lang.ClassLoader.loadClass(Unknown Source)
      at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
      at java.lang.ClassLoader.loadClass(Unknown Source)
      ... 22 more
  
  Results :
  
  Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
  
  [INFO] ------------------------------------------------------------------------
  [INFO] BUILD FAILURE
  [INFO] ------------------------------------------------------------------------
  [INFO] Total time: 4.215 s
  [INFO] Finished at: 2014-11-02T21:42:38-05:00
  [INFO] Final Memory: 6M/16M
  [INFO] ------------------------------------------------------------------------
  [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test (default-test) on project NumberGenerator: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test failed: The forked VM terminated without saying properly goodbye. VM crash or System.exit called ? -&gt; [Help 1]
  [ERROR] 
  [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
  [ERROR] Re-run Maven using the -X switch to enable full debug logging.
  [ERROR] 
  [ERROR] For more information about the errors and possible solutions, please read the following articles:
  [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException
  </code></pre>
  
  <p>Can anyone please help how to solve this issue, thank you</p>