Hi,

Is there anyway to control or influence the reactor build order?

If the parent-as-dependent feature is intentional (and not a bug) then perhaps the <parent> element could have an attribute or child element that allowed you to specify whether you wished the parent to be built first or last.

Of course, I am just thinking out loud because the work-around you mentioned is not intuitive and more than a little messy. Certainly it seemed that way when I explained it to others here.

Thanks for all your help Tim, I really could not see what I was doing wrong and I now understand how to read Maven (logging output) a little better. I am just hoping that the reactor build order is a bug and if not then perhaps it can be influenced.

Cheers,
Evan.

Tim Kettler wrote:
Hi,

just did a quick test. The difference is, that wih the parent element present, the build order of the projects change:

Without Parent:

  [INFO] Scanning for projects...
  [INFO] Reactor build order:
  [INFO]   Unnamed - my-test-group:suba:jar:1.0-SNAPSHOT
  [INFO]   Unnamed - my-test-group:subb:jar:1.0-SNAPSHOT
  [INFO]   Unnamed - my-test-group:parent:pom:1.0-SNAPSHOT

With Parent:

  [INFO] Scanning for projects...
  [INFO] Reactor build order:
  [INFO]   Unnamed - my-test-group:parent:pom:1.0-SNAPSHOT
  [INFO]   Unnamed - my-test-group:suba:jar:1.0-SNAPSHOT
  [INFO]   Unnamed - my-test-group:subb:jar:1.0-SNAPSHOT

It seems, the <parent/> relationship is handled like a dependency between the projects and thus the parent is build before the childs.

I have no time now, but I will ask on the dev-list later today why exactly it is handled this way.

For the time being, the proper way of handling this situation would be to create a parent pom separate from the top-level pom. The childs inherit from the parent and the assembly is build in the top-level pom:
  .
  |-- pom.xml      <---- Top-Level building assembly
  |-- src
  |   `-- main
  |       `-- assembly
  |           `-- developer-assembly.xml
  |-- parent
  |   `-- pom.xml  <---- Child inherit from this
  |-- suba
  |   |-- pom.xml
  |   `-- src
  |       `-- main
  |           `-- java
  |               `-- TestClass.java
  `-- subb
      |-- pom.xml
      `-- src
          `-- main
              `-- java
                  `-- TestClass.java

-Tim



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

Reply via email to