从 Eclipse 在 Tomcat 上运行 Maven 项目 [英] Running Maven project on Tomcat from Eclipse
问题描述
我在 Eclipse 中有一个 Maven 项目.我想将它部署在我本地的 tomcat 服务器中,并像普通的 J2EE 项目一样运行它.
I have a Maven Project in Eclipse. I want to deploy it in my local tomcat server and run it like normal J2EE projects.
但是我发现在 tomcat 添加/删除项目选项中,没有显示任何项目.右键单击 maven 项目并运行,因为没有在服务器上运行选项,或者可能是我遗漏了什么.
But What i found is in tomcat add/remove projects option, no project is shown. Right click on maven project and run as doesn't have Run on Server option or may be I am missing something.
所有我正在寻找在本地 Tomcat 服务器中运行 Maven 项目(来自 eclipse,没有命令提示符或手动复制粘贴 wars)就像普通的 J2EE 项目一样而不修改 pom.xml(说真的我不想修改这个)
All I am looking for running Maven projects (from eclipse, no command prompt or manual copy paste of wars) in local Tomcat server just like normal J2EE projects without modifying pom.xml (seriously I don't want to modify this)
推荐答案
在 Eclipse 中必须安装 Maven Integration for WTP
.此外,此项目必须配置为网络性质.
In Eclipse Maven Integration for WTP
must be installed. Also this project must be configured with web nature.
更新
在您的项目属性中打开 web 性质 -> 项目构面 -> 转换为分面形式... -> 动态 Web 模块 -> 确定
To turn on web nature in your project properties -> Project Facets -> Convert to faceted form... -> Dynamic Web Module -> OK
这篇关于从 Eclipse 在 Tomcat 上运行 Maven 项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!