title: How to send TestNG DefaultSuite results after retryAnalyzer to Maven Surefire Plugin
body: <p>I did search a lot and this is the closest answer that I got but does not solve my problem. <a href="https://stackoverflow.com/questions/13131912/testng-retrying-failed-tests-doesnt-output-the-correct-test-results">TestNG retrying failed tests doesn&#39;t output the correct test results</a></p>
  
  <p>But I need the above problem to extend from TestNG onto Maven. Please help.</p>
  
  <p>My Project stack: TestNG, Maven surefire plugin, Maven. I am running the tests from command line - "mvn clean compile test". I am using a retryanalyzer to re-run the failed tests, that are passing the second time. I have been able to use a CustomListener to update the results stored in the TestNG's testcontext (based on solutions in stackoverflow). This was confirmed when I ran the tests as TestNG suite.</p>
  
  <p>But when I run "mvn clean compile test", all the retries are counted as separate tests and build always fails. How do I make TestNG send only the final Suite results to Maven Surefire plugin ?</p>
  
  <p>TESTNG EXECUTION:</p>
  
  <pre><code>============================================
  DefaultTest
  Total tests run: 4, Failures: 2, Skips: 0
  ============================================
  
  ============================================
  DefaultSuite
  Total tests run: 2, Failures: 0, Skips: 0
  ============================================
  </code></pre>
  
  <p>MAVEN EXECUTION:</p>
  
  <pre><code>Tests run: 4, Failures: 2, Errors: 0, Skipped: 0, Time elapsed: 0.292 sec &lt;&lt;&lt; FAILURE!
  
  Results :
  
  Failed tests: 
    test1(foo.TestClass1)
    test1(foo.TestClass1)
  
  Tests run: 4, Failures: 2, Errors: 0, Skipped: 0
  
  [INFO] ------------------------------------------------------------------------
  [INFO] BUILD FAILURE
  [INFO] ------------------------------------------------------------------------
  </code></pre>
  
  <p>The build passed because of the retry. How do I reflect the TestNG retry Suite results onto Maven ?</p>