Solving EAR deployment dependencies in WildFly and JBoss AS 7

This short tutorial show how you can support inter deployment dependencies on WildFly / JBoss AS 7.

If you have a deployment scenario like this, where you have multiple Enterprise applications which are required to be started up (and shut down) in a certain order:

jboss 7 ear dependencies

Then you can specify the deployment dependency using the jboss-all.xml file which is a JBoss custom XML descriptor for EAR archives. The jboss-all.xml file needs to be placed in the META-INF folder of your EAR archive.

Here's for example how to solve the above dependency between the three EAR files:


<jboss umlns="urn:jboss:1.0">
    <jboss-deployment-dependencies xmlns="urn:jboss:deployment-dependencies:1.0">
        <dependency name="base.ear" />
        <dependency name="app2.ear" />


<jboss umlns="urn:jboss:1.0">
    <jboss-deployment-dependencies xmlns="urn:jboss:deployment-dependencies:1.0">
        <dependency name="base.ear" />

Using a CLI Batch to guarantee deployment order

The deployment order enforced by jboss-all.xml requires, however, that both EAR files are available to the deployer at the same time. If you are deploying the dependent ear first, when the base ear is still not available your deployment will fail.

In this case, the best option to go is relying on a CLI batch which will be able to deploy both EAR files, whatever is the order used to deploy them:


deploy app1.ear
deploy app2.ear




Related articles available on

How to configure JBoss to disable hot deployment ?

On JBoss AS 7 and WildFly the default rule is that archived appli

How do I make sure my MBean is deployed after my EJB ?

  If your MBean is dependant on another resource, supposing cont

How do I change the default lib directory in an ear file?

  Supposing you have an Enterprise application which has been pa

How to let JBoss deploy an application after other apps?

  If you are running JBoss AS 7 or WildFly check the following t

How to deploy an application temporarly with JBoss ?

One way to do it, is using the jboss.system:service=MainDeployer

How to add a custom JBoss archive in an Ear ?

JBoss custom archives (like .sar or .har) are not recognized by t

Follow us on Twitter