dimanche 26 juillet 2015

maven-surefire-plugin: java.lang.NoSuchMethodError: org.testng.TestNG.configure(Ljava/util/Map;)V

I'm trying to execute tests on Java/TestNG using "mvn clean test" command. Looks like something is wrong in pom, but i have no idea what.

pom.xml

<project xmlns="http://ift.tt/IH78KX" xmlns:xsi="http://ift.tt/ra1lAU"
    xsi:schemaLocation="http://ift.tt/IH78KX http://ift.tt/VE5zRx">
    <modelVersion>4.0.0</modelVersion>
    <groupId>Tests</groupId>
    <artifactId>GmailTest</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <packaging>jar</packaging>


    <properties>
        <seleniumVersion>2.42.2</seleniumVersion>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

        <junit.version>4.8.2</junit.version>
   </properties>

    <repositories>
        <repository>
            <id>maven2.gueck.com-releases</id>
            <url>http://ift.tt/1S4hIzK;
        </repository>
        <repository>
            <id>repo1</id>
            <url>http://ift.tt/1cmbEvS;
        </repository>
        <repository>
            <id>repo2</id>
            <url>http://ift.tt/1GgOrMk;

        </repository>
    </repositories>

    <dependencies>


        <dependency>
            <groupId>org.seleniumhq.selenium</groupId>
            <artifactId>selenium-chrome-driver</artifactId>
            <version>${seleniumVersion}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.seleniumhq.selenium</groupId>
            <artifactId>selenium-htmlunit-driver</artifactId>
            <version>${seleniumVersion}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.uncommons</groupId>
            <artifactId>reportng</artifactId>
            <version>1.1.2</version>
        </dependency>
       <dependency>
            <groupId>org.testng</groupId>
            <artifactId>testng</artifactId>
            <version>6.9.4</version>
        </dependency>
        <dependency>
        <groupId>org.apache.maven.surefire</groupId>
        <artifactId>surefire-testng</artifactId>
        <version>2.18.1</version>
        </dependency>



    </dependencies>

 <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>2.18.1</version>
           <configuration>
        <suiteXmlFiles>
          <suiteXmlFile>testng.xml</suiteXmlFile>
        </suiteXmlFiles>
      </configuration>
        </plugin>
      </plugins>
    </pluginManagement>
  </build>


</project>

Error code:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.18.1:test (default-test) on project GmailTest: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:2.18.1:test failed: There was an error in the forked process
[ERROR] java.lang.NoSuchMethodError: org.testng.TestNG.configure(Ljava/util/Map;)V
[ERROR] at org.apache.maven.surefire.testng.conf.TestNGMapConfigurator.configure(TestNGMapConfigurator.java:53)
[ERROR] at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:292)
[ERROR] at org.apache.maven.surefire.testng.TestNGXmlTestSuite.execute(TestNGXmlTestSuite.java:84)
[ERROR] at org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:90)
[ERROR] at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:203)
[ERROR] at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:155)
[ERROR] at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)

I've tried to find missing resources or repositories, without any luck. Anyone have any idea how to deal with that?

Aucun commentaire:

Enregistrer un commentaire