Wednesday, August 20, 2014

How to Configure Embedded Jetty Server with Maven

Hi Guys,

Through this post, I will show how to configure the embedded jetty server plugin with maven projects. First let's see what is Jetty. Jetty is a light weight web server. In it you can deploy your web application during the development phrase.

The Jetty Maven plugin is useful for rapid development and testing. You can add it to any webapp project that is structured according to the usual Maven defaults. The plugin can then periodically scan your project for changes and automatically redeploy the webapp if any are found. This makes the development cycle more productive by eliminating the build and deploy steps.

Lets see how to setup the jetty server into maven projects

First step, Create a maven web app project.  use the following command in to create a new hello world project.



Once your project creation successful, a new web application project named “hello-webapp“, and the entire project directory structure is created automatically. Then go to that project root directory and open the pom.xml and then add the following code block within the build tag.

Once you add this plugin, you can deploy your hello-webapp application into jetty-server. To deploy the webapp in to jetty server, you the command as follows


then to view your web app in your browser localhost:8080/hello-webapp then try more complicated examples.