Search code examples
eclipsemavenm2eeclipse-wtpmaven-war-plugin

How to run an eclipse m2e webapp project on a local server?


I'm trying to create a simple webapp as a maven project with m2e to help me manage dependencies, but I'm must be missing something, because I'm not able to run the project from eclipse.

To put a bit more context, here is what I do:

First, I choose to create a "Maven project"

enter image description here

Then, I select the "maven-webapp-archetype"

enter image description here

Finally, I fill the basic project information form of the next step and finalize project creation. Everything looks fine at this point.

The problem is that when I try to run the project, I don't find anything suitable to run the project on a local server:

enter image description here

Also, from the "Add and remove..." context menu entry of the local server, my project doesn't appear in the list of web projects.

Did I miss a step in the setup, or is there an other more suitable way to start the project?


Solution

  • You should install the m2e-wtp connector.

    You can install this from: Window, Preferences, Maven, Discovery, click Open Catalog and search for wtp. Check the box next to m2e-wtp, and click Finish.

    Once the installation process has completed, allow it to restart Eclipse. After that, you may need to right click on the project, choose Maven and Update project.