How to Get the jetty-runner.jar

Using Jetty Runner

The idea of the Jetty Runner is extremely simple–run a webapp from the command line using a single Jar and as much default configuration as possible:

java -jar jetty-runner.jar my.war

Jetty starts on port 8080 and deploys the my.war webapp.

You can also deploy multiple webapps–either packed or unpacked WARs–from the command line. In this example, my.war is available at http://host:8080/one and the my2 webapp is available at http://host:8080/two:

java -jar jetty-runner.jar --path /one my1.war --path /two my2

Or, for those webapps that need a little more configuration, you can run them via jetty context config files:

java -jar jetty-runner.jar contexts/my.xml

You can configure the most common elements from the command line, such as the port to start on, and whether to generate a request log or not:

You must also tell Jetty where to find your database driver and Atomikos, which we use to provide a transaction manager and wrap XA and non-XA Resources into a DataSource you can access from your webapp. Notice the --lib argument, which is one way to tell Jetty about extra jars you want to put onto the container's classpath. You can also use:

--jar <filename> --classes <dir>

In addition, you can get full configuration control using a jetty.xml configuration file: