maven项目打包跳过test

Maven项目打包时候跳过测试的几个方法这里备注下。

方法一

在 pom 中添加插件的形式

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

方法二

通过idea 工具实现,点击右上角 有点像闪电样子的图标,看到 test 被划掉了。然后点击maven 打包的功能就可以跳过测试了。


image.png

方法三

spring-boot-maven-plugin插件已经集成了maven-surefire-plugin插件
只需要在pom.xml里增加
<skipTests>true</skipTests>
即可。

<properties>
    <skipTests>true</skipTests>
</properties>
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容