Jetty server configuration would be added as a maven plugin
<!--Jetty config-
<build>
<pluginManagement>
<plugins><plugin> <groupId>Org.mortbay.jetty</groupId> <Artifactid>Jetty-maven-plugin</Artifactid> <version>8.1.7.v20120910</version> <Configuration> <webappsourcedirectory>${project.build.directory}/[your proj name]</webappsourcedirectory> <webApp> <!--You can put the. properties file in Configration folder other than resource folder - <Extraclasspath>${basedir}/configuration</Extraclasspath> <ContextPath>/[your proj name]</ContextPath> <Connectors> <!--Work around file locking on Windows, this app port - <connectorImplementation= "Org.eclipse.jetty.server.nio.SelectChannelConnector"> <Port>8098</Port> </connector> </Connectors> <systemproperties> <Systemproperty> <name>Log4j.config.location</name> <value>${basedir}/configuration</value> <Systemproperty> </Systemproperty> <name>App.install.root</name> <value>${basedir}</value> </Systemproperty> <Systemproperty> <name>org.apache.jasper.compiler.disablejsr199</name> <value>True</value> </Systemproperty> </systemproperties> </Configuration> </plugin> <!--Other plugins - </Plugins>
</pluginManagement>
</Build>
With this configuration, you should is able to the use MVN Jetty:run to start jetty server.
How to add and configure Jetty server in Maven Pom.xml