title: java.lang.NoClassDefFoundError: org/openqa/selenium/WrapsElement error executing Selenium based mvn test
body: <p>So I am trying to run tests using <code>mvn test -P</code> and it is giving me <code>java.lang.NoClassDefFoundError: org/openqa/selenium/WrapsElement</code> when I run it from the cmd although it is working fine from within eclipse itself.</p>
  
  <p>I have my pages classes <code>src/main/java</code> and my tests in <code>src/test/java</code>, I just can't get why it would work perfectly fine from eclipse but not from the command prompt. I assume it has something to do with the pom.xml but I am not sure</p>
  
  <p>Here is my pom.xml:</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;selenium&lt;/groupId&gt;
  &lt;artifactId&gt;taf&lt;/artifactId&gt;
  &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
  &lt;packaging&gt;jar&lt;/packaging&gt;
  
  &lt;name&gt;taf&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;pluginManagement&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.8.1&lt;/version&gt;
                  &lt;configuration&gt;
                      &lt;source&gt;8&lt;/source&gt;
                      &lt;target&gt;8&lt;/target&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                  &lt;artifactId&gt;maven-surefire-plugin&lt;/artifactId&gt;
                  &lt;version&gt;3.0.0-M4&lt;/version&gt;
                  &lt;configuration&gt;
                      &lt;suiteXmlFiles&gt;
                          &lt;suiteXmlFile&gt;${testNGSuite}&lt;/suiteXmlFile&gt;
                      &lt;/suiteXmlFiles&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                  &lt;artifactId&gt;maven-surefire-plugin&lt;/artifactId&gt;
                  &lt;version&gt;2.22.0&lt;/version&gt;
                  &lt;configuration&gt;
                      &lt;additionalClasspathElements&gt;
                          &lt;additionalClasspathElement&gt;${project.basedir}/target/classes&lt;/additionalClasspathElement&gt;
                      &lt;/additionalClasspathElements&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
          &lt;/plugins&gt;
      &lt;/pluginManagement&gt;
  &lt;/build&gt;
  &lt;dependencies&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;com.github.javafaker&lt;/groupId&gt;
          &lt;artifactId&gt;javafaker&lt;/artifactId&gt;
          &lt;version&gt;1.0.1&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;com.googlecode.json-simple&lt;/groupId&gt;
          &lt;artifactId&gt;json-simple&lt;/artifactId&gt;
          &lt;version&gt;1.1.1&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;com.opencsv&lt;/groupId&gt;
          &lt;artifactId&gt;opencsv&lt;/artifactId&gt;
          &lt;version&gt;5.0&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.apache.poi&lt;/groupId&gt;
          &lt;artifactId&gt;poi-ooxml&lt;/artifactId&gt;
          &lt;version&gt;4.1.1&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;io.qameta.allure&lt;/groupId&gt;
          &lt;artifactId&gt;allure-testng&lt;/artifactId&gt;
          &lt;version&gt;2.13.0&lt;/version&gt;
          &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;com.codeborne&lt;/groupId&gt;
          &lt;artifactId&gt;phantomjsdriver&lt;/artifactId&gt;
          &lt;version&gt;1.4.4&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;io.cucumber&lt;/groupId&gt;
          &lt;artifactId&gt;cucumber-java&lt;/artifactId&gt;
          &lt;version&gt;4.8.0&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;io.cucumber&lt;/groupId&gt;
          &lt;artifactId&gt;cucumber-core&lt;/artifactId&gt;
          &lt;version&gt;4.8.0&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;io.cucumber&lt;/groupId&gt;
          &lt;artifactId&gt;cucumber-junit&lt;/artifactId&gt;
          &lt;version&gt;4.8.0&lt;/version&gt;
          &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;io.cucumber&lt;/groupId&gt;
          &lt;artifactId&gt;cucumber-testng&lt;/artifactId&gt;
          &lt;version&gt;4.8.0&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;info.cukes&lt;/groupId&gt;
          &lt;artifactId&gt;gherkin&lt;/artifactId&gt;
          &lt;version&gt;2.12.2&lt;/version&gt;
          &lt;scope&gt;provided&lt;/scope&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.testng&lt;/groupId&gt;
          &lt;artifactId&gt;testng&lt;/artifactId&gt;
          &lt;version&gt;7.0.0&lt;/version&gt;
          &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.apache.httpcomponents&lt;/groupId&gt;
          &lt;artifactId&gt;httpclient&lt;/artifactId&gt;
          &lt;version&gt;4.5.6&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.seleniumhq.selenium&lt;/groupId&gt;
          &lt;artifactId&gt;selenium-java&lt;/artifactId&gt;
          &lt;version&gt;3.141.59&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.seleniumhq.selenium&lt;/groupId&gt;
          &lt;artifactId&gt;selenium-common&lt;/artifactId&gt;
          &lt;version&gt;2.0b1&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.apache.commons&lt;/groupId&gt;
          &lt;artifactId&gt;commons-io&lt;/artifactId&gt;
          &lt;version&gt;1.3.2&lt;/version&gt;
      &lt;/dependency&gt;
  &lt;/dependencies&gt;
  &lt;profiles&gt;
      &lt;profile&gt;
          &lt;id&gt;regression&lt;/id&gt;
          &lt;activation&gt;
              &lt;activeByDefault&gt;true&lt;/activeByDefault&gt;
              &lt;property&gt;
                  &lt;name&gt;environment&lt;/name&gt;
                  &lt;value&gt;regression&lt;/value&gt;
              &lt;/property&gt;
          &lt;/activation&gt;
          &lt;properties&gt;
              &lt;testNGSuite&gt;RegressionSuite.xml&lt;/testNGSuite&gt;
          &lt;/properties&gt;
      &lt;/profile&gt;
      &lt;profile&gt;
          &lt;id&gt;full&lt;/id&gt;
          &lt;activation&gt;
              &lt;activeByDefault&gt;true&lt;/activeByDefault&gt;
              &lt;property&gt;
                  &lt;name&gt;environment&lt;/name&gt;
                  &lt;value&gt;full&lt;/value&gt;
              &lt;/property&gt;
          &lt;/activation&gt;
          &lt;properties&gt;
              &lt;testNGSuite&gt;testng.xml&lt;/testNGSuite&gt;
          &lt;/properties&gt;
      &lt;/profile&gt;
  &lt;/profiles&gt;
  </code></pre>
  
  <p></p>
  
  <p>And that is a part of my projects tree:
  <a href="https://i.stack.imgur.com/T3XeX.jpg" rel="nofollow noreferrer">project tree</a></p>