Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] Deployment order of webapps in Jetty 9

webapp load order isn't supported by jetty-deploy or the DeploymentManager.

But never fear, you can manually add the required webapps that need to come first, and then let the DeploymentManager handle the rest.

Lets assume you have a war called example.war that you want to ensure is deployed and started first.

Here's the process:

[~]$ cd my-base
[my-base]$ mkdir prewebapps
[my-base]$ cp ~/code/project/target/example-1.0-SNAPSHOT.war prewebapps/example.war
[my-base]$ mkdir etc
[my-base[$ cp ~/code/project/prewebapps.xml etc/prewebapps.xml
[my-base]$ echo "prewebapps.xml" >> start.ini
[my-base]$ cat etc/prewebapps.xml
<?xml version="1.0"?>
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure_9_0.dtd">
<Configure id="Contexts" class="org.eclipse.jetty.server.handler.ContextHandlerCollection">
  <Call name="addHandler">
    <Arg>
      <New class="org.eclipse.jetty.webapp.WebAppContext">
        <Set name="contextPath">/example</Set>
        <Set name="war"><Property name="jetty.base" default="."/>/prewebapps/example.war</Set>
      </New>
    </Arg>
  </Call>
</Configure>


The key points:
  • Put the example.war into a directory that is NOT the ${jetty.base}/webapps/ directory
    (as you don't want it to be picked up by the standard jetty-deploy / DeploymentManger techniques)
  • You are configuring the existing "Contexts" (id) to manually add those webapps.
    This means you don't have a separate XML for each war file (like you would with the jetty-deploy techniques)
    Instead what was a separate XML is now embedded in this ${jetty.base}/etc/prewebapps.xml file.

Good luck


--
Joakim Erdfelt <joakim@xxxxxxxxxxx>
Expert advice, services and support from from the Jetty & CometD experts

On Fri, Oct 17, 2014 at 7:56 AM, John Preston <byhisdeeds@xxxxxxxxx> wrote:
Can someone tell me which is the easiest way to get my deployment order for webapps in jetty 9. I understand that I can specify the order in one of the xml config files but I cant figure it out.

_______________________________________________
jetty-users mailing list
jetty-users@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/jetty-users


Back to the top