Uploaded image for project: 'Maven Surefire'
  1. Maven Surefire
  2. SUREFIRE-1762

skipAfterFailureCount>0 with testng 7.1.0 resulting in java.lang.NoSuchMethodError: org.testng.TestNG.addListener(Lorg/testng/ITestListener;)V

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.0.0-M4
    • 3.0.0-M5
    • TestNG support
    • None

    Description

      When using maven-surefire-plugin with configuration

      <configuration>
        <suiteXmlFiles>
          <suiteXmlFile>testng.xml</suiteXmlFile>
        </suiteXmlFiles>
        <skipAfterFailureCount>1</skipAfterFailureCount>
      </configuration>
      

      this results in

      java.lang.NoSuchMethodError: org.testng.TestNG.addListener(Lorg/testng/ITestListener;)V
              at org.apache.maven.surefire.testng.TestNGExecutor.postConfigure(TestNGExecutor.java:312)
              at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:280)
              at org.apache.maven.surefire.testng.TestNGXmlTestSuite.execute(TestNGXmlTestSuite.java:75)
              at org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:120)
              at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:377)
              at org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:138)
              at org.apache.maven.surefire.booter.ForkedBooter.run(ForkedBooter.java:465)
              at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:451)
      

      For reproducing use the attached pom.xml and testng.xml and execute

      mvn -B -e clean test
      

      Attachments

        1. pom.xml
          0.9 kB
          Lutz Neugebauer
        2. testng.xml
          0.2 kB
          Lutz Neugebauer

        Activity

          People

            tibordigana Tibor Digana
            lne3 Lutz Neugebauer
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: