简体   繁体   中英

Control order of WAR file deployment in JBoss EAP 7.2.0

I have developed two Spring Boot applications, one is Cloud Config Server and the other is a Spring Boot application that fetches property from Config Server. I have deployed the two applications as WAR files in JBoss EAP. I am deploying the WAR files in sequence, deploying the Config Server before the other application. Problem is happening after I restart the server, the second war file is getting deployed before the war file for Config Server.

I Jboss EAP 7.2.0, how will I ensure that the WAR file for Config Server is always deployed before the WAR file of the other application?

You can control the startup order of deployment by using jboss-all.xml deployment descriptor to declare dependencies between the deployments.

Example: If you want foo.ear is deployed before bar.ear then you can create an bar.ear/META-INF/jboss-all.xml file like this:

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

[1] https://access.redhat.com/documentation/en-us/red_hat_jboss_enterprise_application_platform/7.1/html/configuration_guide/deploying_applications#control_order_deployments

[2] https://access.redhat.com/solutions/88763

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM