共有三种解决办法
1.通过在命令行设置:-Dmaven.test.skip=true
mvn clean install tomcat:run -Dmaven.test.skip=true
2.通过在命令行设置:-DskipTests
mvn clean install tomcat:run -DskipTests
3.通过在pom.xml配置文件进行配置
<project>
[...]
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<skipTests>true</skipTests>
</configuration>
</plugin>
</plugins>
</build>
[...]
</project>
官方文档描述:http://maven.apache.org/plugins-archives/maven-surefire-plugin-2.12.4/examples/skipping-test.html