users@glassfish.java.net

RE: How to guarantee deployment order for ejb/war modules ?

From: Martin Gainty <mgainty_at_hotmail.com>
Date: Tue, 19 Apr 2011 21:25:00 -0400

you can use maven deploy task which will control the deploy order to
1)deploy child modules
2)then deploy the current parent project
 
<!-- lets say you have jar1 and jar2 which is used to construct (parent) ear project e.g. where the pom.xml looks like -->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">

  <modelVersion>4.0.0</modelVersion>
  <groupId>package</groupId>
  <artifactId>parent-artifact</artifactId>
  <version>1.5</version>
</project>
<modules>
    <module>jar1</module>
    <module>jar2</module>
  </modules>
</project>

<!-- the jar1 child pom would reference the parent-artifact like this: -->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <parent>
    <groupId>package</groupId>
    <artifactId>parent-artifact</artifactId>
    <version>1.5</version>
  </parent>
  <groupId>package</groupId>

  <artifactId>jar1</artifactId>

  <version>1.5</version>
......
</project>
<!-- ..............use the above jar1 project to copy to jar2 ............... -->

cd parent-artifact
execute and deploy all module pom.xml:
mvn deploy:deploy-file

<!-- jar1 is compiled, packaged and deployed -->
<!-- jar2 is compiled, packaged and deployed -->
<!-- parent-artifact is compiled, packaged and deployed -->

Martin Gainty
______________________________________________
"nothing is impossible"..stanley jobson in swordfish




> Date: Tue, 19 Apr 2011 21:00:50 -0400
> From: hong.hz.zhang_at_oracle.com
> To: users_at_glassfish.java.net
> Subject: Re: How to guarantee deployment order for ejb/war modules ?
>
> Please see my previous reply to your post:
>
> http://forums.java.net/node/792884
>
> - Hong
>
> On 4/19/2011 9:09 AM, boraldo wrote:
> > I have several ejb/war modules that are not inside ear. I want to deploy them
> > separately. They interchange information that's why I need to guarantee the
> > order of their deployment when I restart server.
> > How can I do this?
> >