Tuesday, 18 October 2011

Configuring a context root different from war file name to deploy to Jetty


<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure.dtd">
<Configure class="org.eclipse.jetty.webapp.WebAppContext">
<Set name="contextPath">/myapp</Set>
<Set name="war"><SystemProperty name="jetty.home" default="."/>/webapps/com.mycompany.web.myapp.war</Set>
<Set name="extractWAR">true</Set>
<Set name="copyWebDir">false</Set>
<Set name="defaultsDescriptor"><SystemProperty name="jetty.home" default="."/>/etc/webdefault.xml</Set>
</Configure>


ant clean dist
cp dist/com.mycompany.web.myapp.war /[your_path_to_jetty_install]/webapps

No comments:

Post a comment