When I’m writing a Java servlet using Maven, I find it convenient to be able to run the Java servlet in a local servlet container for testing purposes. This is very easy to do using the Jetty Maven plugin.
To add the Jetty Maven plugin to your project, modify pom.xml as follows: