maven打包时跳过TEST的方式汇总

使用maven打包时如何跳过test,有以下几种方式

针对spring项目

<plugin>  
        <groupId>org.apache.maven.pluginsgroupId>  
        <artifactId>maven-surefire-pluginartifactId>  
        <version>2.18.1version>  
        <configuration>  
            <skipTests>trueskipTests>  
        configuration>  
plugin>  

针对springboot

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

添加如下信息:

<properties>
		<project.build.sourceEncoding>UTF-8project.build.sourceEncoding>
		<project.reporting.outputEncoding>UTF-8project.reporting.outputEncoding>
		<java.version>1.8java.version>
		
		<skipTests>trueskipTests>
	properties>

方式三(通用)

mvn clean install -DskipTests

方式四(通用)

mvn clean install -Dmaven.test.skip=true

你可能感兴趣的:(JAVA,Maven,maven,java,spring,boot)