Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12:test (default-test) on project.

前端 未结 28 1413
予麋鹿
予麋鹿 2020-12-03 06:41

I have been trying from a couple of days to resolve the following error but I am unable to resolve it :(

My module\'s pom.xml file is:



        
相关标签:
28条回答
  • 2020-12-03 06:59

    3 years already, but the same thing happened to me and I wanted to contribute with my case. Using the @nikk solution I got better results, but other errors still appeared, although yes, I was allowed to package.

    However, my task was to implement the code of a co-worker on the server and it did not happen to him in his test environment, so I decided to investigate a little more since the code was functional and did not correspond to me touching anything .

    In the end it turned out that his application inserted mysql tables into a database that did not exist. The solution was as easy as creating such a database and the error disappeared.

    0 讨论(0)
  • 2020-12-03 07:01

    It worked for me with version 3.0.0-M1.

    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>3.0.0-M1</version>
    </plugin>
    

    You might need to run it with sudo.

    0 讨论(0)
  • 2020-12-03 07:05

    This solved my issue. It was 2.10 in my POM, just updated to 2.19.1 and refresh the POM

    Add to your pom :

     <plugins>
            <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-surefire-plugin</artifactId>
              <version>2.19.1</version>
            </plugin>
      </plugins>
    

    In your error code he didn't find surefire plugin so add it

    0 讨论(0)
  • 2020-12-03 07:05

    I get exactly the same stacktrace when tests fail. More to the top you should see messages identfying the failing test classes. Or go to

    D:\Masters\thesis related papers and tools\junitcategorizer\junitcategorizer.instrument\target\surefire-reports
    

    and have a look at the failure reports. Fix the problems and your build is ok.

    Good news : Your poms seem to be ok, Maven can compile and execute tests.

    0 讨论(0)
  • 2020-12-03 07:05

    I just adjust the cucumber version, because I had a JUnit dependency in a low version compared with the other version of cucumber in my pom file.

    
    <!-- https://mvnrepository.com/artifact/io.cucumber/cucumber-java -->
                <dependency>
                    <groupId>io.cucumber</groupId>
                    <artifactId>cucumber-java</artifactId>
                    <version>6.9.0</version>
                </dependency>
        
                <!-- https://mvnrepository.com/artifact/io.cucumber/cucumber-picocontainer -->
                <dependency>
                    <groupId>io.cucumber</groupId>
                    <artifactId>cucumber-picocontainer</artifactId>
                    <version>6.9.0</version>
                    <scope>test</scope>
                </dependency>
        
                <!-- https://mvnrepository.com/artifact/io.cucumber/cucumber-junit -->
                <dependency>
                    <groupId>io.cucumber</groupId>
                    <artifactId>cucumber-junit</artifactId>
                    <version>6.9.0</version>
                    <scope>test</scope>
                </dependency>
    
    0 讨论(0)
  • 2020-12-03 07:07

    HI All can you try adding the below in your POM and then use mvn clean compile and then mvn install.

    <!-- https://mvnrepository.com/artifact/junit/junit -->
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.12</version>
        <scope>test</scope>
    </dependency>
    
    0 讨论(0)
提交回复
热议问题