title: Run TestNG suite from maven getting error:maven-surefire-plugin:test failed: testSuiteXmlFiles0 has null value
body: <p>I see a lot of posts on here about running a TestNG suite using Maven surefire plugin. The examples say to add this to the pom:</p>
  
  <pre><code>&lt;configuration&gt;
      &lt;suiteXmlFiles&gt;
          &lt;suiteXmlFile&gt;${testSuite}&lt;/suiteXmlFile&gt;
      &lt;/suiteXmlFiles&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p>And then this to the command line:</p>
  
  <pre><code>mvn test -DtestSuite=myCustomSuite.xml
  </code></pre>
  
  <p>My problem with this is that it ties you to using the TestNG suite... For example, if I want to run with groups like this:</p>
  
  <pre><code>mvn test -Dgroups=myGroup
  </code></pre>
  
  <p>I get this error:</p>
  
  <blockquote>
    <p>maven-surefire-plugin:2.18.1:test failed: testSuiteXmlFiles0 has null value</p>
  </blockquote>
  
  <p>I want to be able to run, from command line, passing in either a suite path or groups.</p>