有2种方式 :
1.使用命令的时候带上参数
/**
*编译
*/
mvn install -Dmaven.test.skip=true
/**
*打包
*/
mvn package -Dmaven.test.skip=true
2.在pom.xml里面配置
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>