Deploy to tomcat from eclipse via M2eclipse and Maven

I use M2E to create Maven archetype projects (in this case, a simple web application) to use Maven to deploy to a tomcat remote server.

I added the tomcat-maven plugin to the POM.XML file and it seems to be correct.

<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 the terminal, it deploys successfully. Therefore, I know that my settings.xml as well as my tomcat settings are ok.

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?

Greetings

+4
source share
1 answer

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

You can also configure the server view in Eclipse (WTP) and simply deploy (or automatically expand after changing the file) directly from eclipse (maven is not used in this process, it is only responsible for setting the proper nature of your project - ex war).

Maven Integration for Eclipse WTP (aka m2e-wtp) aims to provide tight integration between Maven Integration for Eclipse (aka m2e) and Eclipse Web Tools Project (WTP).

m2e-wtp provides a set of m2e connectors used to configure Java EE projects in WTP. He has:

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

Read also: Maven / Tomcat projects in Eclipse Indigo / 3.7

+4
source

Source: https://habr.com/ru/post/1393616/


All Articles