Spring Boot skips maven test

Source: Internet
Author: User

Every time eclipse uses the run as-a Maven install, it always runs JUnit test, some of which are associated with databases, and some are more dangerous. How do I skip the test skip testing?
The Spring-boot-maven-plugin plugin has integrated the Maven-surefire-plugin plug-in to add only in Pom.xml

1
<properties>
2
<!--maven Way to skip MAVEN test, equivalent $ mvn package-dmaven.test.skip=true--
3
<!--<maven.test.skip>true</maven.test.skip>--
4
<!--Surefire Plugin way to skip Maven test, equivalent to $ mvn package-dskiptests
5
<skipTests>true</skipTests>
6
</properties>
It is important to note that Maven.test.skip, skipping all classes related to test, does not generate a. class, and if the JUnit test is allowed to find ClassNotFound errors, skiptests compiles the test class. The. class file is generated, but the test class is not run, and you can run the test class manually.
I skipped MAVEN test this way when I didn't use spring boot before, and Pom.xml added:
1
<plugin>
2
    <groupId>org.apache.maven.plugins</groupId>
3
    <artifactId>maven-surefire-plugin</artifactId>
4
    <version>2.12.4</version>
5
    <configuration>
6
        <skipTests>true</skipTests>
7
    </configuration>
8
</plugin>


Reference: http://maven.apache.org/plugins-archives/maven-surefire-plugin-2.12.4/examples/skipping-test.html


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.