简体   繁体   English

从eclipse在Tomcat中部署

[英]Deploying in Tomcat from eclipse

I am using Maven, Eclipse and Tomcat to develop a web application which consists of different modules. 我正在使用Maven,Eclipse和Tomcat开发一个由不同模块组成的Web应用程序。 When I build the project using Maven I am getting a war file for each module. 当我使用Maven构建项目时,我得到每个模块的war文件。 My question is how to deploy that generated modules into Tomcat server from Eclipse. 我的问题是如何将生成的模块部署到Eclipse的Tomcat服务器中。

take this war file to webapps directory in tomcat, simply you can rename the file name to Root.war and run the tomcat 将此war文件带到tomcat中的webapps目录,只需将文件名重命名为Root.war并运行tomcat即可

reference 参考

As your are saying that you have different modules there, those will be named like XXXDAO, XXXcommon etc, 正如你所说的那样你有不同的模块,那些将被命名为XXXDAO,XXXcommon等,

Option-1: simply try right click on each module and you will see the option 选项-1:只需右键单击每个模块,您将看到该选项

right click on prject --> Run As --> Run on Server

Among all the module only one module will show this option that is your actual war that will use all other war files 在所有模块中,只有一个模块将显示此选项,即您将使用所有其他war文件的实际战争

Option-2: if you know about that module then just put that war and put it in web apps folder in tom cat and start tomcat. 选项2:如果您了解该模块,那么只需将该战争放入tom cat中的web apps文件夹中并启动tomcat。

if not help you then please show the project and directory structure of your projects. 如果没有帮助,那么请显示项目的项目和目录结构。

Note: Your application's Pom.xml will help/guid you a lot. 注意:您的应用程序的Pom.xml将帮助/指导您。 try using that 尝试使用它

A good way to do it with just Maven is to use the cargo-maven-plugin . 只使用Maven的一个好方法就是使用cargo-maven-plugin This also makes deployment container-agnostic, and provides several other benefits. 这也使得部署容器不可知,并提供了其他一些好处。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM