Monday, May 05, 2008

JBoss Have a war dependant on ear

Sometimes you need a war to be deployed only after a certain ear has been deployed for example if you need the war and the ear to have the same context.

use the <depends> tag in jboss-web.xml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE jboss-web PUBLIC "-//JBoss//DTD Web Application 2.3//EN" "http://www.jboss.org/j2ee/dtd/jboss-web_3_2.dtd">
<jboss-web>
<context-root>/yourcontext</context-root>
<depends>jboss.j2ee:service=EARDeployment,url='yourear.ear'</depends>
</jboss-web>

No comments: