Maven 2 Jetty plugin

This plugin is for running a web application directly from Maven.

It currently support running the generated war file as a web application in Jetty, with the run-war goal. This goal will execute the package phase and then run Jetty with the generated war as a web application. By default, Jetty will run on port 8080, with the context path set to app/ and the location of the war file set to $$ You can alternatively specify your own properties or create a Jetty xml configuration file.

Available Configuration Options

contextPathSpecOptional/appThe context path
webAppOptional$$ location of the war file
jettyConfigOptionalThe location of a Jetty xml configuration file,
it will override all other parameters

Using the plugin

Add the plugin to your POM's plugin configuration:


You can configure your plugin with the optional parameters, by following the instructions found in the Getting Started Guide.

Then run m2 with one of the available goals:

m2 jetty:run-war

Point you browser to http://localhost:<port>/<contextPathSpec>/