title: maven package class not found selenium Web Driver
body: <p>I'm creating maven application where I'm getting information from website.</p>
  
  <p>I created maven package, but when I run jar using command: 
  "java -jar app-1.0-SNAPSHOT.jar" I get this error:</p>
  
  <p>"java.lang.ClassNotFoundException: org.openqa.selenium.WebDriver"</p>
  
  <p>It works good when I'm running it in IntelliJ.</p>
  
  <p>This is my pom:</p>
  
  <pre><code>&lt;groupId&gt;app&lt;/groupId&gt;
  &lt;artifactId&gt;app&lt;/artifactId&gt;
  &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
  
  &lt;dependencies&gt;
  &lt;dependency&gt;
      &lt;groupId&gt;org.seleniumhq.selenium&lt;/groupId&gt;
      &lt;artifactId&gt;selenium-java&lt;/artifactId&gt;
      &lt;version&gt;2.53.1&lt;/version&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
      &lt;groupId&gt;org.seleniumhq.selenium&lt;/groupId&gt;
      &lt;artifactId&gt;selenium-htmlunit-driver&lt;/artifactId&gt;
      &lt;version&gt;2.52.0&lt;/version&gt;
  &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;com.itextpdf&lt;/groupId&gt;
          &lt;artifactId&gt;itextpdf&lt;/artifactId&gt;
          &lt;version&gt;5.0.6&lt;/version&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;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;plugin&gt;
              &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
              &lt;artifactId&gt;maven-jar-plugin&lt;/artifactId&gt;
              &lt;configuration&gt;
                  &lt;archive&gt;
                      &lt;manifest&gt;
                          &lt;addClasspath&gt;true&lt;/addClasspath&gt;
                          &lt;classpathPrefix&gt;lib/&lt;/classpathPrefix&gt;
                          &lt;mainClass&gt;sample.Main&lt;/mainClass&gt;
                      &lt;/manifest&gt;
                  &lt;/archive&gt;
              &lt;/configuration&gt;
          &lt;/plugin&gt;
          &lt;plugin&gt;
              &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
              &lt;artifactId&gt;maven-dependency-plugin&lt;/artifactId&gt;
              &lt;version&gt;2.10&lt;/version&gt;
              &lt;executions&gt;
                  &lt;execution&gt;
                      &lt;id&gt;copy-dependencies&lt;/id&gt;
                      &lt;phase&gt;package&lt;/phase&gt;
                      &lt;goals&gt;
                          &lt;goal&gt;copy-dependencies&lt;/goal&gt;
                      &lt;/goals&gt;
                      &lt;configuration&gt;
                          &lt;includeScope&gt;runtime&lt;/includeScope&gt;
                          &lt;outputDirectory&gt;${project.build.directory}/dependency-jars/&lt;/outputDirectory&gt;
                      &lt;/configuration&gt;
                  &lt;/execution&gt;
              &lt;/executions&gt;
          &lt;/plugin&gt;
      &lt;/plugins&gt;
  &lt;/build&gt;
  </code></pre>
  
  <p></p>
  
  <p>Please help me find out what is wrong. Thanks!</p>