title: How to run selenium testNG test cases using maven from command line?
body: <p>While running my test case from maven using following command</p>
  
  <pre><code>c:\&gt; mvn test
  </code></pre>
  
  <p>I am getting following result:</p>
  
  <pre><code> D:\arpit_maven\mavenProject\build_demo&gt;mvn test
  [INFO] Scanning for projects...
  [INFO]
  [INFO] ------------------------------------------------------------------------
  [INFO] Building build_demo 1.0-SNAPSHOT
  [INFO] ------------------------------------------------------------------------
  [INFO]
  [INFO] --- maven-resources-plugin:2.5:resources (default-resources) @ build_demo
   ---
  [debug] execute contextualize
  [INFO] Using 'UTF-8' encoding to copy filtered resources.
  [INFO] skip non existing resourceDirectory D:\arpit_maven\mavenProject\build_dem
  o\src\test\resources
  [INFO]
  [INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ build_demo --
  -
  [INFO] Nothing to compile - all classes are up to date
  [INFO]
  [INFO] --- maven-resources-plugin:2.5:testResources (default-testResources) @ bu
  ild_demo ---
  [debug] execute contextualize
  [INFO] Using 'UTF-8' encoding to copy filtered resources.
  [INFO] skip non existing resourceDirectory D:\arpit_maven\mavenProject\build_dem
  o\src\test\resources
  [INFO]
  [INFO] --- maven-compiler-plugin:2.3.2:testCompile (default-testCompile) @ build
  _demo ---
  [INFO] Nothing to compile - all classes are up to date
  [INFO]
  [INFO] --- maven-surefire-plugin:2.10:test (default-test) @ build_demo ---
  [INFO] Surefire report directory: D:\arpit_maven\mavenProject\build_demo\target\
  surefire-reports
  
  -------------------------------------------------------
   T E S T S
  -------------------------------------------------------
  
  Results :
  
  Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
  
  [INFO] ------------------------------------------------------------------------
  [INFO] BUILD SUCCESS
  [INFO] ------------------------------------------------------------------------
  [INFO] Total time: 3.031s
  [INFO] Finished at: Thu Mar 21 10:29:17 IST 2013
  [INFO] Final Memory: 5M/15M
  [INFO] ------------------------------------------------------------------------
  D:\arpit_maven\mavenProject\build_demo&gt;
  </code></pre>
  
  <p>My POM.xml is as follows. Please let me know if anything is missing in pom.xml.
  My test case is in src\test\java\ folder. </p>
  
  <pre class="lang-xml prettyprint-override"><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;demo1&lt;/groupId&gt;
  &lt;artifactId&gt;build_demo&lt;/artifactId&gt;
  &lt;packaging&gt;jar&lt;/packaging&gt;
  &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
  &lt;name&gt;build_demo&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;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.33.0&lt;/version&gt;
  
      &lt;/dependency&gt;
  
   &lt;dependency&gt;
    &lt;groupId&gt;junit&lt;/groupId&gt;
    &lt;artifactId&gt;junit&lt;/artifactId&gt;
    &lt;version&gt;3.8.1&lt;/version&gt;
    &lt;scope&gt;test&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;6.8.1&lt;/version&gt;
  &lt;scope&gt;test&lt;/scope&gt;
  &lt;/dependency&gt;
  &lt;dependency&gt;
          &lt;groupId&gt;org.apache.poi&lt;/groupId&gt;
          &lt;artifactId&gt;poi&lt;/artifactId&gt;
          &lt;version&gt;3.8&lt;/version&gt;
      &lt;/dependency&gt; 
  &lt;/dependencies&gt;
  &lt;build&gt;
      &lt;resources&gt;
          &lt;resource&gt;
              &lt;directory&gt;src/test/resources&lt;/directory&gt;
              &lt;filtering&gt;true&lt;/filtering&gt;
          &lt;/resource&gt;
      &lt;/resources&gt;
       &lt;plugins&gt;
       &lt;plugin&gt;
       &lt;groupId&gt;org.apache.mavan.plugins&lt;/groupId&gt;
       &lt;artifactId&gt;mavan-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;profiles&gt;
      &lt;profile&gt;
          &lt;id&gt;selenium-tests&lt;/id&gt;
          &lt;build&gt;
              &lt;plugins&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.4.3&lt;/version&gt;
                      &lt;configuration&gt;
                          &lt;includes&gt;
                              &lt;include&gt;Opencart.java&lt;/include&gt;
                          &lt;/includes&gt;
                      &lt;/configuration&gt;
                  &lt;/plugin&gt;
              &lt;/plugins&gt;
          &lt;/build&gt;
      &lt;/profile&gt;
   &lt;/profiles&gt;
  &lt;/project&gt;
  </code></pre>