-Dskiptests: do not execute test cases, but compile test case classes to generate corresponding class files under target / test classes.
– Dmaven.test.skip=true , do not execute test cases, and do not compile test case classes.
Do not execute the test case, but compile the test case class to generate the corresponding class file to target / test classes.
I. use maven.test.skip To skip not only the running of unit tests, but also the compiling of test code.
mvn package -Dmaven.test.skip=true
It can also be in the pom.xml File modification
<plugin>
<groupId>org.apache.maven.plugin</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.1</version>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.5</version>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
Second, use MVN package – dskipstests to skip the unit test, but will continue to compile; if there is no time to modify the unit test bug, or the unit test compilation error. Use the one above, not this one
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.5</version>
<configuration>
<skipTests>true</skipTests>
</configuration>
</plugin>
=
Read More:
- Maven skip unit test
- Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.1:test (default-test)
- [Solved] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.2:test
- Multithreading: when doing unit test, use thread pool to find that the specified code is not running and skip directly
- Failed to execute goal org.apache.maven . plugins:maven-surefire-plugin :2.12.4:test
- Caused by: org.apache.maven.plugin.MojoFailureException: There are test failures.
- [details] jar conflict resolution in Maven (personal test)
- [Solved] Unit test automatically injects error reporting nullpointer
- The import Maven project appears http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException Solutions
- Error resolving version for plugin ‘org.apache.maven.plugins:maven-compiler-plugin’ from the repo…
- Solve the problem of springboot and unit test starting applicationrunner
- The usage of Java JUnit unit test and the solution of initialization error
- Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile)
- Junit4 unit test reports an error invalid project specified
- import org.junit.Test And @ test error reporting — solutions
- Failed to execute goal in Maven build org.apache.tomcat .maven:
- Error in idea unit test command line is too long
- “[warning] failed to retrieve plugin descriptor for caused by Maven security agent settings org.apache.maven . plugins:… “
- RocketMQ Failed to execute goal org.apache.maven.plugins:maven-checkstyle-plugin:2.17:check…
- 解决Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.7.0:compile