简体   繁体   English

通过M2eclipse和Maven从eclipse部署到tomcat

[英]Deployment to tomcat from eclipse via M2eclipse and Maven

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. 我正在使用M2E创建Maven原型项目(在本例中是一个简单的Web应用程序),目的是使用Maven部署到远程tomcat服务器。

I've added the tomcat-maven-plugin to the POM.XML file, and it appears to be correct. 我已经将tomcat-maven-plugin添加到POM.XML文件中,看起来是正确的。

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

and when I type "mvn tomcat:deploy" into terminal it deploys successfully. 当我在终端输入“mvn tomcat:deploy”时,它会成功部署。 So I know my settings.xml as well as my tomcat settings are in order. 所以我知道我的settings.xml以及我的tomcat设置是有序的。

Is it possible to deploy the application directly from Eclipse without having to go through the terminal. 是否可以直接从Eclipse部署应用程序而无需通过终端。 In other words is it possible to pass the command "mvn tomcat:deploy" from eclipse to maven? 换句话说,是否可以将命令“mvn tomcat:deploy”从eclipse传递给maven?

Cheers 干杯

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

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)中配置服务器视图,并直接从eclipse部署(或在文件更改后自动部署)(在此过程中不使用maven,他只负责配置项目的正确性质 - 例如,战争) 。

Maven Integration for Eclipse WTP (aka m2e-wtp) aims at providing a tight integration between Maven Integration for Eclipse (aka m2e) and the Eclipse Web Tools Project (WTP) . Eclipse的Maven集成WTP(又名m2e-wtp)旨在提供Maven Integration for Eclipse(aka m2e)和Eclipse Web Tools Project(WTP)之间的紧密集成。

m2e-wtp provides a set of m2e connectors used for the configuration of Java EE projects in WTP. m2e-wtp提供了一组m2e连接器,用于在WTP中配置Java EE项目。 It features : 它的特点是:

Support for war projects : adds the Java and Dynamic Web Facets. 支持war项目:添加Java和Dynamic Web Facets。 Support war overlays and on-the-fly resource filtering 支持战争覆盖和动态资源过滤

Read also this: Maven/Tomcat Projects In Eclipse Indigo/3.7 另请阅读: Eclipse Indigo / 3.7中的Maven / Tomcat项目

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

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