通过M2eclipse和Maven从eclipse部署到tomcat [英] Deployment to tomcat from eclipse via M2eclipse and Maven

查看:198
本文介绍了通过M2eclipse和Maven从eclipse部署到tomcat的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用M2E创建Maven原型项目(在本例中为简单的Web应用程序),目的是使用Maven部署到远程tomcat服务器.

I'm using M2E to create Maven archetype projects (in this case a simple web app) with the aim of using Maven to deploy to a remote tomcat server.

我已将tomcat-maven-plugin添加到POM.XML文件,它似乎是正确的.

I've added the tomcat-maven-plugin to the POM.XML file, and it appears to be correct.

         <plugin>
           <groupId>org.codehaus.mojo</groupId>
           <artifactId>tomcat-maven-plugin</artifactId>
           <configuration>
                <server>localServer</server>
           </configuration>
         </plugin>

,当我在终端中输入"mvn tomcat:deploy"时,它会成功部署.所以我知道我的settings.xml以及我的tomcat设置是正确的.

and when I type "mvn tomcat:deploy" into terminal it deploys successfully. So I know my settings.xml as well as my tomcat settings are in order.

是否可以直接从Eclipse部署应用程序而不必通过终端.换句话说,是否可以将命令"mvn tomcat:deploy"从Eclipse传递到Maven?

Is it possible to deploy the application directly from Eclipse without having to go through the terminal. In other words is it possible to pass the command "mvn tomcat:deploy" from eclipse to maven?

欢呼

推荐答案

您可以直接从Eclipse Run Configurations运行所有maven目标. http://mevenide.codehaus.org/mevenide-ui- eclipse/user-guide/run.html

You can run all maven goal directly from Eclipse Run Configurations http://mevenide.codehaus.org/mevenide-ui-eclipse/user-guide/run.html

您还可以在Eclipse(WTP)中配置服务器视图,并直接从eclipse直接部署(或在文件更改后自动部署)(此过程中未使用Maven,他仅负责配置项目的适当性质-例如(战争).

Also you can configure Server View in Eclipse (WTP) and simply deploy (or auto deploy after file change) directly from eclipse (maven is not used in this process, he is only responsible for configure proper nature of your project - ex. war).

Eclipse WTP的Maven集成(也称为m2e-wtp)旨在提供 Maven Integration for Eclipse(也称为m2e)之间的紧密集成 和Eclipse Web Tools Project(WTP).

Maven Integration for Eclipse WTP (a.k.a m2e-wtp) aims at providing a tight integration between Maven Integration for Eclipse (a.k.a m2e) and the Eclipse Web Tools Project (WTP) .

m2e-wtp提供了一组m2e连接器,用于配置 WTP中的Java EE项目.它具有以下特点:

m2e-wtp provides a set of m2e connectors used for the configuration of Java EE projects in WTP. It features :

对战争项目的支持:添加了Java和Dynamic Web Facets. 支持战争叠加和动态资源过滤

Support for war projects : adds the Java and Dynamic Web Facets. Support war overlays and on-the-fly resource filtering

也请阅读以下内容: Eclipse Indigo/3.7中的Maven/Tomcat项目

这篇关于通过M2eclipse和Maven从eclipse部署到tomcat的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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