Hi all,

I am having a problem with building/installing POM's that depend on each other.
My question is: how can I enfore a specific build order in multiproject builds?


Basically, the configuration (stripped down to be able to isolate the problem) is as follows:
A 'parent':


<project>
<name>Parent POM</name>
<groupId>_test</groupId>
<artifactId>parent</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>pom</packaging> </project>


and a 'child' that extends the 'parent':

<project>
<name>Child POM</name>
<groupId>_test</groupId>
<artifactId>child</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>pom</packaging>
<parent>
<groupId>_test</groupId>
<artifactId>parent</artifactId>
<version>1.0-SNAPSHOT</version>
</parent> </project>


So far, so good.
Now I am trying to build  these two POM's with a third one which looks like:

   <project>
       <groupId>_test</groupId>
       <artifactId>modules</artifactId>
       <version>1.0-SNAPSHOT</version>
       <packaging>pom</packaging>
       <modules>
           <module>parent</module>
           <module>child</module>
       </modules>
   </project>

The 'parent' and 'child' POM's are located in a 'parent' and 'child' subdirectory under the directory of this last POM.

When I run 'm2 install' on this last POM, the build fails because it tries to build the the 'child' before the 'parent'.
Since the child is based on the parent, it will try to download it which fails since it hasn't been build and deployed.


Apparently the modules are not built in the order in which they are specified in the <modules> section but alphabetically, since when I change the name of the 'child' directory to 'zchild' the build order is correct. It builds the parent first (Note that only the directory name had to be changed, not the <artifactId>).

My question is: how can I enfore a specific build order in multiproject builds?
Is a parent-child relationship not automatically considered a dependency in a multiproject?
I tried to solve it by explicitly stating that the child depends on the parent by inserting a <dependency> in the child but that did not work.


Any help is appreciated.
Thanks in advance,
Peter van de Hoef


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to