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