Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.10:test

前端 未结 14 1892
夕颜
夕颜 2020-11-29 16:35

I have scoured the internet for almost five days now looking for a fix to this issue, but I cannot seem to find and fix it on my own, mainly because I am so new to both Mave

相关标签:
14条回答
  • 2020-11-29 17:22

    please follow this tutorial: https://www.petrikainulainen.net/programming/maven/creating-code-coverage-reports-for-unit-and-integration-tests-with-the-jacoco-maven-plugin/

    <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-surefire-plugin</artifactId>
    <version>2.15</version>
    <configuration>
        <!-- Sets the VM argument line used when unit tests are run. -->
        <argLine>${surefireArgLine}</argLine>
        <!-- Skips unit tests if the value of skip.unit.tests property is true -->
        <skipTests>${skip.unit.tests}</skipTests>
        <!-- Excludes integration tests when unit tests are run. -->
        <excludes>
            <exclude>**/IT*.java</exclude>
        </excludes>
    </configuration>
    

    0 讨论(0)
  • 2020-11-29 17:29

    This error occurs if some unit test cases are failing.

    In my application, certain unit tests were not compatible with Java 8 so they were failing. My error was resolved after changing jdk1.8.0_92 to jdk1.7.0_80.

    The build would succeed with mvn clean install -DskipTests but this will skip the unit tests. So just ensure that you run then separately after the build is complete.

    0 讨论(0)
提交回复
热议问题