Setup Jetty/Maven for developing web applications in Eclipse

This article describes how to set up the development environment in Eclipse to run/debug web applications for Maven based projects.


First you would need to add Eclipse plugin to run Maven tasks. I use the Maven Integration [2]. Follow the instruction in the web site on how to install the plugin in Eclipse.

Second, add jetty plugin to your project’s pom.xml file. For example



More configuration options can be found in the plugin documentation [2].

Config and Run

Now you are ready to configure Eclipse to run/debug your web application on Jetty.

Open Eclipse’s Run Configuration and create a new configuration under Maven Build and enter jetty:run in Goal field. Running the configuration will start a Jetty instance on localhost:8080.

To debug jetty, open Eclipse’s Run Configuration and create another new configuration under Maven Build. Set the Goal value to jetty:run as before.  Then enter the following in the VM arguments field under the JRE tab:

-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=4000,server=y,suspend=y

Now create a new Debug Configuration under Remove Java Application. Make sure the port number is identical to the value set above (i.e. 4000).

To run Jetty in debug mode, first start the jetty:run run configuration. The following will be displayed in the Eclipse Console:

Listening for transport dt_socket at address: 4000

Now start the debug configuration and Jetty should be started.

To stop jetty, create and run a Run Configuration under Maven Build with Goal jetty:stop.

More Info

  1. Jetty –
  2. Maven Integration m2e plugins –
  3. Jetty Maven plugin –