maven打包跳过test代码几种方式

spring项目处理:

<plugin>  
        <groupId>org.apache.maven.plugins</groupId>  
        <artifactId>maven-surefire-plugin</artifactId>   
        <configuration>  
            <skip>true</skip>
            <testFailureIgnore>true</testFailureIgnore>
        </configuration>  
</plugin>  

springboot项目:

<plugin>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-maven-plugin</artifactId>
</plugin>

properties标签添加如下信息:

img

maven打包命令处理:

mvn clean install -DskipTests
mvn clean install -Dmaven.test.skip=true