Web Application + Maven + Eclipse

To make use of Maven and still test our application with Eclipse Tomcat Server module, we need to add to the application the web module in order to add our application to the Server without much effort.

1. Project Facets Settings

Here we need to add the web module to the application so to add the application later on the server.

_images/ScreenClip[10].png
_images/ScreenClip[11].png
_images/ScreenClip[13].png

2. Deployment Assembly

We need to change the path to the web folder. By default Eclipse will look for WebContent folder we need to change it to web.

Note

Delete the WebContent from the source too!

_images/ScreenClip[8].png
_images/ScreenClip[7].png
_images/ScreenClip[6].png

3. Add Application to Server

Now we can add the application to the Server

_images/ScreenClip[12].png
_images/ScreenClip[9].png

4. Web Module Settings

By default the root context will be /[project name], we need to change it to only /.

_images/ScreenClip[5].png
_images/ScreenClip[4].png
_images/ScreenClip[3].png

5. Compile & Run

Compile and run the application as usual and make sure the label on the right of the server name say Synchronized.

_images/ScreenClip[14].png
_images/ScreenClip[15].png