Search code examples
javaservletsjettywarhttpserver

How to deploy a WAR to Jetty by copying to $JETTY_HOME/webapps?


Having installed Jetty, it's certainly running as I get a welcome page.

How do I manually deploy a WAR to Jetty?

If you have a standard web application, you can hot deploy it into Jetty by copying it into the webapps directory.

Where is the webapps directory? Or, how do I find the directory?

See also:

  1. Deploying by Copying WAR

The easiest way to deploy a web application to Jetty server is probably by copying the WAR file into the $JETTY_HOME/webapps directory.

output from dpkg -L jetty9 as a gist shows:

/usr/share/jetty9/logs
/usr/share/jetty9/start.d
/usr/share/jetty9/start.ini
/usr/share/jetty9/start.jar
/usr/share/jetty9/webapps

and:

/var/cache/jetty9
/var/lib
/var/lib/jetty9
/var/lib/jetty9/webapps
/var/lib/jetty9/webapps/README.TXT
/var/log
/var/log/jetty9
/usr/share/doc/jetty9/README.Debian

Solution

  • On Ubuntu Jetty by default webapps directory is /var/lib/jetty/webapps.

    To be sure, please check list of installed files (and to which directories they have been copied):

    dpkg -L jetty