title: Not able to execute testng file from Maven Project . Exception on Maven Surefire plugin
body: <p>I have created Maven project for testing one of my web application. I wanted to execute my project based on few parameters. So I added few parameters to my POM.XML and passed those properties as input to my plugins. </p>
  
  <p>During execution of my maven project, I am getting below error for last two days 
  <strong>[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.20:test (default-test) on project Sanity: No tests were executed!  (Set -DfailIfNoTests=false to ignore this error.) -> [Help 1]</strong></p>
  
  <p>I even referred the earlier stack over flow link   to resolve this error.[<a href="https://stackoverflow.com/questions/36427868/failed-to-execute-goal-org-apache-maven-pluginsmaven-surefire-plugin2-12test][1]">Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12:test (default-test) on project.</a> </p>
  
  <p>But none of the solutions helped me to resolve the issue. I tried most of the solutions suggested</p>
  
  <pre><code>1) Tried cleaning project
  2) updated my maven project and dependencies. 
  3) Ran in debug mode also
  4) Recreated my maven project also
  </code></pre>
  
  <p>Please share your suggestions to resolve this issue</p>
  
  <p>Also, I am posting my POM.XML file from Build tag remvoing dependecy plugins, Test Ng file, Java file used for invoking</p>
  
  <pre><code>     - POM.XML
  
  
      &lt;properties&gt;
          &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
          &lt;!-- This configuration need to be modified for the environment to be run and type of test to be executed --&gt;
          &lt;test&gt;Web&lt;/test&gt;
          &lt;!-- Sanity, Regression --&gt;
          &lt;testtype&gt;Sanity&lt;/testtype&gt;
          &lt;sanitysuiteFile&gt;Sanity.xml&lt;/sanitysuiteFile&gt;
          &lt;regressionsuiteFile&gt;Regression.xml&lt;/regressionsuiteFile&gt;
      &lt;/properties&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.20&lt;/version&gt;
          &lt;configuration&gt;
              &lt;suiteXmlFiles&gt;
                  &lt;suiteXmlFile&gt;${sanitysuiteFile}&lt;/suiteXmlFile&gt;
              &lt;/suiteXmlFiles&gt;
          &lt;/configuration&gt;
      &lt;/plugin&gt;
  &lt;/plugins&gt;
  &lt;/build&gt;
  &lt;/project&gt;
  
       - TestNg.XML
      &lt;?xml version="1.0" encoding="UTF-8"?&gt;
      &lt;!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd"&gt;
      &lt;suite name="Suite"&gt;
        &lt;test name="Test"&gt;
         &lt;parameter name="selenium.env" value="UAT" /&gt;
        &lt;parameter name="selenium.browser" value="IE" /&gt;
        &lt;parameter name="selenium.pbrowser" value="Mozilla" /&gt; 
          &lt;classes&gt;
            &lt;class name="test.SanityTest"/&gt;
          &lt;/classes&gt;
        &lt;/test&gt; &lt;!-- Test --&gt;
      &lt;/suite&gt; &lt;!-- Suite --&gt;
  </code></pre>
  
  <p>Below error received when ran the project in debug mode</p>
  
  <pre><code>[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.20:test (default-test) on project Sanity: No tests were executed!  (Set -DfailIfNoTests=false to ignore this error.) -&gt; [Help 1]
  org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.20:test (default-test) on project Sanity: No tests were executed!  (Set -DfailIfNoTests=false to ignore this error.)
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
      at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
      at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
      at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
      at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
      at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
      at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
      at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
      at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
      at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
      at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
      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.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
      at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
      at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
      at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
  Caused by: org.apache.maven.plugin.MojoFailureException: No tests were executed!  (Set -DfailIfNoTests=false to ignore this error.)
      at org.apache.maven.plugin.surefire.SurefireHelper.reportExecution(SurefireHelper.java:86)
      at org.apache.maven.plugin.surefire.SurefirePlugin.handleSummary(SurefirePlugin.java:334)
      at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeAfterPreconditionsChecked(AbstractSurefireMojo.java:937)
      at org.apache.maven.plugin.surefire.AbstractSurefireMojo.execute(AbstractSurefireMojo.java:785)
      at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
      ... 20 more
  [ERROR] 
  </code></pre>