title: I have a testNG.xml file which is generated dynamically in run time
body: <p>Initially I have a blank testng.xml file, So I am writing to this file dynamically from my excel suite file. But when I execute this file from Jenkins or from local pom.xml file, I get the below exception. So is there a way where we first write into the testNG.xml file then calling it from POM. This looks like I need one method to execute before @Before suite.</p>
  
  <pre><code>[INFO] Scanning for projects...
  [INFO]                                                                         
  [INFO] ------------------------------------------------------------------------
  [INFO] Building restautomation 0.0.1-SNAPSHOT
  [INFO] ------------------------------------------------------------------------
  [INFO] 
  [INFO] --- maven-enforcer-plugin:1.4:enforce (enforce-plugin-versions) @ restautomation ---
  [INFO] 
  [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ restautomation ---
  [INFO] Using 'UTF-8' encoding to copy filtered resources.
  [INFO] skip non existing resourceDirectory C:\Users\C47273\Xen Desktop\Workspaces\restautomation\src\main\resources
  [INFO] 
  [INFO] --- maven-compiler-plugin:3.0:compile (default-compile) @ restautomation ---
  [INFO] Nothing to compile - all classes are up to date
  [INFO] 
  [INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ restautomation ---
  [INFO] Using 'UTF-8' encoding to copy filtered resources.
  [INFO] skip non existing resourceDirectory C:\Users\C47273\Xen Desktop\Workspaces\restautomation\src\test\resources
  [INFO] 
  [INFO] --- maven-compiler-plugin:3.0:testCompile (default-testCompile) @ restautomation ---
  [INFO] Nothing to compile - all classes are up to date
  [INFO] 
  [INFO] --- maven-surefire-plugin:2.19.1:test (default-test) @ restautomation ---
  
  -------------------------------------------------------
   T E S T S
  -------------------------------------------------------
  Running TestSuite
  
  Results :
  
  Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
  
  [INFO] ------------------------------------------------------------------------
  [INFO] BUILD FAILURE
  [INFO] ------------------------------------------------------------------------
  [INFO] Total time: 6.083 s
  [INFO] Finished at: 2019-07-18T16:51:56+02:00
  [INFO] Final Memory: 16M/225M
  [INFO] ------------------------------------------------------------------------
  [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.19.1:test (default-test) on project restautomation: 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: org.xml.sax.SAXParseException; Premature end of file.
  [ERROR] at org.testng.TestNG.parseSuite(TestNG.java:327)
  [ERROR] at org.testng.TestNG.initializeSuitesAndJarFile(TestNG.java:348)
  [ERROR] at org.testng.TestNG.initializeEverything(TestNG.java:995)
  [ERROR] at org.testng.TestNG.run(TestNG.java:1009)
  [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: org.xml.sax.SAXParseException; Premature end of file.
  [ERROR] at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
  [ERROR] at org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown Source)
  [ERROR] at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
  [ERROR] at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
  [ERROR] at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
  [ERROR] at org.apache.xerces.impl.XMLVersionDetector.determineDocVersion(Unknown Source)
  [ERROR] at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
  [ERROR] at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
  [ERROR] at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
  [ERROR] at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
  [ERROR] at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
  [ERROR] at org.apache.xerces.jaxp.SAXParserImpl.parse(Unknown Source)
  [ERROR] at javax.xml.parsers.SAXParser.parse(SAXParser.java:195)
  [ERROR] at org.testng.xml.XMLParser.parse(XMLParser.java:38)
  [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:152)
  [ERROR] at org.testng.xml.Parser.parse(Parser.java:233)
  [ERROR] at org.testng.TestNG.parseSuite(TestNG.java:295)
  [ERROR] ... 9 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>