Java IntelliJ IDEA 14:如何在将项目部署到 Tomcat 时跳过测试
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/32006351/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
IntelliJ IDEA 14: How to skip tests while deploying project into Tomcat
提问by stevey
I have a Spring MVCproject using IntelliJ IDEA14 as my IDE (I'm new to IntelliJ IDEA; I used Eclipse).
我有一个Spring MVC项目,它使用IntelliJ IDEA14 作为我的 IDE(我是 IntelliJ IDEA 的新手;我使用了Eclipse)。
My main Java code is in folder src/main
, and the unit test code is in src/test
. While deploying the project, I found that all the unit tests are executed.
我的主要 Java 代码在文件夹中src/main
,单元测试代码在src/test
. 在部署项目时,我发现所有的单元测试都被执行了。
How can I skip all the unit tests while deploying the project into Tomcat?
将项目部署到 Tomcat 时如何跳过所有单元测试?
采纳答案by dimitrisli
In case you are using Maven
, on the View
> Tool Windows
> Maven Projects
click on the button shown below ( called Skip Tests Mode
). Essentially it is taking the test
phase out of the lifecycle when you say run package
.
如果您使用的Maven
是View
> Tool Windows
>Maven Projects
单击下面显示的按钮(称为Skip Tests Mode
)。从本质上讲,test
当您说 run 时,它是在生命周期之外的阶段package
。