MAVEN Development Skips unit tests
Recently done Maven project, because the project is very large, each unit test will take a lot of time, in line with the principle of saving time, want to skip the unit test part, so the web looked for two scenarios, respectively, in the DOS environment operating maven and operating maven in Eclipse. Maven provides the ability to skip unit tests, using only the parameters of the Surefire plug-in skip .
DOS, you can skip the test simply by adding a property to any target maven.test.skip :
$ mvn install-dmaven.test.skip=true ... [INFO] [Compiler:testcompile] [INFO] Not compiling test sources[info] [Surefire:test][info] Tests is skipped ....
When the Surefire plugin arrivestestThe target, ifmaven.test.skipSet totrue, it skips unit tests. Another way to configure Maven to skip unit tests is to give your projectpom.xmlAdd this configuration. You need to do for yourbuildAdd topluginElements.
<project> [...] <build> <plugins> <plugin> <groupid>org.apache.maven.plugins</groupid > <artifactId>maven-surefire-plugin</artifactId> <configuration> <skip> true</skip> </configuration> </plugin> </plugins> </build> [...] </project>
---maven development skip Unit Test for Java Learning article