---maven development skip Unit Test for Java Learning article

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.