title: Can't run TestNG Test Suite in a maven project
body: <p>I'm trying to execute a profile with mvn -PProfileName
  But i'm getting errors, it seems that my pom.xml is correct and testngsuite.xml is correct too.
  I can execute my code from the .java without any problem</p>
  
  <p><strong>Pom.xml</strong></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;com.bilog&lt;/groupId&gt;
      &lt;artifactId&gt;IncidentDashboardAutomation&lt;/artifactId&gt;
      &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
      &lt;packaging&gt;jar&lt;/packaging&gt;
  
      &lt;name&gt;IncidentDashboardAutomation&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.testng&lt;/groupId&gt;
              &lt;artifactId&gt;testng&lt;/artifactId&gt;
              &lt;version&gt;6.9.10&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;2.53.0&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;com.relevantcodes&lt;/groupId&gt;
              &lt;artifactId&gt;extentreports&lt;/artifactId&gt;
              &lt;version&gt;2.40.2&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.ini4j&lt;/groupId&gt;
              &lt;artifactId&gt;ini4j&lt;/artifactId&gt;
              &lt;version&gt;0.5.4&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;com.paulhammant&lt;/groupId&gt;
              &lt;artifactId&gt;ngwebdriver&lt;/artifactId&gt;
              &lt;version&gt;0.9.6&lt;/version&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;log4j&lt;/groupId&gt;
              &lt;artifactId&gt;log4j&lt;/artifactId&gt;
              &lt;version&gt;1.2.17&lt;/version&gt;
          &lt;/dependency&gt;
      &lt;/dependencies&gt;
  
  
      &lt;profiles&gt;
          &lt;profile&gt;
              &lt;id&gt;RegressionTest&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.19.1&lt;/version&gt;
                          &lt;configuration&gt;
                              &lt;suiteXmlFiles&gt;
                                  &lt;suiteXmlFile&gt;regression.xml&lt;/suiteXmlFile&gt;
                              &lt;/suiteXmlFiles&gt;
                          &lt;/configuration&gt;
                      &lt;/plugin&gt;
                  &lt;/plugins&gt;
              &lt;/build&gt;
          &lt;/profile&gt;
          &lt;profile&gt;
              &lt;id&gt;Theriaque&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.19.1&lt;/version&gt;
                          &lt;configuration&gt;
                              &lt;suiteXmlFiles&gt;
                                  &lt;suiteXmlFile&gt;theriaque.xml&lt;/suiteXmlFile&gt;
                              &lt;/suiteXmlFiles&gt;
                          &lt;/configuration&gt;
                      &lt;/plugin&gt;
                  &lt;/plugins&gt;
              &lt;/build&gt;
          &lt;/profile&gt;
      &lt;/profiles&gt;
  
  &lt;/project&gt;
  </code></pre>
  
  <p><strong>regression.xml</strong></p>
  
  <pre><code>&lt;suite name="IncidentDashboardSuite"&gt;
      &lt;test name="Incident Dashboard Templae" preserve-order="true"&gt;
          &lt;class name="com.bilog.IncidentDashboardAutomation.IncidentDashboardMainTestSuite.java"&gt;
          &lt;/class&gt;
      &lt;/test&gt;
  &lt;/suite&gt;
  </code></pre>
  
  <p><strong>Errors I'm getting in eclipse console :</strong></p>
  
  <pre><code>[TestNGContentHandler] [WARN] It is strongly recommended to add "&lt;!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" &gt;" at the top of your file, otherwise TestNG may fail or not work as expected.
  org.testng.TestNGException: java.lang.NullPointerException
      at org.testng.TestNG.initializeSuitesAndJarFile(TestNG.java:325)
      at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:90)
      at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:206)
      at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:177)
  Caused by: java.lang.NullPointerException
      at org.testng.xml.TestNGContentHandler.endElement(TestNGContentHandler.java:722)
      at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(Unknown Source)
      at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(Unknown Source)
      at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(Unknown Source)
      at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source)
      at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(Unknown Source)
      at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
      at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
      at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
      at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
      at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)
      at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
      at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.parse(Unknown Source)
      at javax.xml.parsers.SAXParser.parse(Unknown Source)
      at org.testng.xml.XMLParser.parse(XMLParser.java:39)
      at org.testng.xml.SuiteXmlParser.parse(SuiteXmlParser.java:16)
      at org.testng.xml.SuiteXmlParser.parse(SuiteXmlParser.java:9)
      at org.testng.xml.Parser.parse(Parser.java:172)
      at org.testng.TestNG.initializeSuitesAndJarFile(TestNG.java:305)
      ... 3 more
  </code></pre>
  
  <p><strong>Errors i'm getting after mvn test-PRegressionTest</strong></p>
  
  <pre><code>[INFO] ------------------------------------------------------------------------
  [INFO] BUILD FAILURE
  [INFO] ------------------------------------------------------------------------
  [INFO] Total time: 6.584 s
  [INFO] Finished at: 2016-08-04T14:12:31+02:00
  [INFO] Final Memory: 11M/245M
  [INFO] ------------------------------------------------------------------------
  [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.19.1:test (default-test) on project IncidentDashboardAutomation: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:2.19.1:test failed: There was an error in the forked process
  [ERROR] org.testng.TestNGException: java.lang.NullPointerException
  [ERROR] at org.testng.TestNG.initializeSuitesAndJarFile(TestNG.java:325)
  [ERROR] at org.testng.TestNG.run(TestNG.java:1036)
  [ERROR] at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:281)
  [ERROR] at org.apache.maven.surefire.testng.TestNGXmlTestSuite.execute(TestNGXmlTestSuite.java:75)
  [ERROR] at org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:121)
  [ERROR] at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:290)
  [ERROR] at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:242)
  [ERROR] at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:121)
  [ERROR] Caused by: java.lang.NullPointerException
  [ERROR] at org.testng.xml.TestNGContentHandler.endElement(TestNGContentHandler.java:722)
  [ERROR] at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:609)
  [ERROR] at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(XMLDocumentFragmentScannerImpl.java:1783)
  [ERROR] at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2970)
  [ERROR] at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:606)
  [ERROR] at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:118)
  [ERROR] at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510)
  [ERROR] at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:848)
  [ERROR] at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:777)
  [ERROR] at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
  [ERROR] at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1213)
  [ERROR] at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:643)
  [ERROR] at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.parse(SAXParserImpl.java:327)
  [ERROR] at javax.xml.parsers.SAXParser.parse(SAXParser.java:195)
  [ERROR] at org.testng.xml.XMLParser.parse(XMLParser.java:39)
  [ERROR] at org.testng.xml.SuiteXmlParser.parse(SuiteXmlParser.java:16)
  [ERROR] at org.testng.xml.SuiteXmlParser.parse(SuiteXmlParser.java:9)
  [ERROR] at org.testng.xml.Parser.parse(Parser.java:172)
  [ERROR] at org.testng.TestNG.initializeSuitesAndJarFile(TestNG.java:305)
  [ERROR] ... 7 more
  [ERROR] -&gt; [Help 1]
  [ERROR]
  [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
  [ERROR] Re-run Maven using the -X switch to enable full debug logging.
  [ERROR]
  [ERROR] For more information about the errors and possible solutions, please read the following articles:
  [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException
  </code></pre>
  
  <p>PS : when I write mvn test -PRegressionTest,I get : Unknown lifecycle phase "test-PRegressionTest"</p>
  
  <p>Thanks !</p>