To reach high productivity it is paramount to use JRebel from ZeroTurnaround so that your modifications are reloaded automatically without requiring a context reload or a container restart. Below we show how you can run any Mentawai web application with Jetty + Maven + JRebel.
Configuring Jetty in Maven:
<plugin> <groupId>org.mortbay.jetty</groupId> <artifactId>jetty-maven-plugin</artifactId> <version>7.1.0.v20100505</version> <configuration> <webApp>${basedir}/target/${project.artifactId}.war</webApp> <webAppConfig> <contextPath>/${project.artifactId}</contextPath> </webAppConfig> <reload>manual</reload> <connectors> <connector implementation="org.eclipse.jetty.server.bio.SocketConnector"> <port>8080</port> </connector> </connectors> </configuration> </plugin>
Starting Jetty with JRebel:
#!/bin/bash
export REBEL_HOME=~/JRebel
export MAVEN_OPTS="-noverify -javaagent:$REBEL_HOME/jrebel.jar $MAVEN_OPTS"
mvn jetty:run