使用带有IntelliJ的maven在tomcat中运行应用程序 [英] Run app in tomcat using maven with IntelliJ

查看:119
本文介绍了使用带有IntelliJ的maven在tomcat中运行应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

不使用maven,要从Intellij IDE在tomcat上运行应用程序,你所要做的就是创建一个工件和一个指向该工件的tomcat运行配置,这样你就可以看到tomcat输出,重新启动服务器,以及IDE中的其他东西。

Without using maven, to run the app on tomcat from the Intellij IDE, all you have to do is create an artifact and a "tomcat" run configuration pointing to that artifact, this way you can see tomcat output, restart the server, and other stuff right in the IDE.

现在使用maven,不需要创建工件,因为maven已经进行了编译,打包等。

Now using maven, there's no need to create an artifact, because maven already does the compiling, packaging, etc.

我知道我可以使用命令 mvn tomcat7:redeploy 来部署它但这样我看不到标准输出/错误和调试。
那么从IntelliJ运行应用程序的标准方法是什么而不必创建工件?

I know i can deploy it using the command mvn tomcat7:redeploy but this way i can't see standart output/errors and debug. So what is the standard way to run the app from IntelliJ without having to create an artifact?

推荐答案

如果你设置

<packaging>war</packaging>

,IDEA应自动识别要部署的工件(您的WAR文件)。无需手动创建工件。

in your pom, IDEA should automatically identify the artifact (your WAR file) to deploy. No need to manually create an artifact.

这篇关于使用带有IntelliJ的maven在tomcat中运行应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆