On Wed, Mar 19, 2008 at 9:11 AM, [EMAIL PROTECTED] < [EMAIL PROTECTED]> wrote:
> Hi, > > There was recently a question on this list about how to implement an odd > build order for submodules in a multi-module project. I said that it > wasn't possible, but Brian corrected me and said that in fact it is > automatic. > > So after some pondering, I have come to the following conclusion. Can > someone confirm if I have this right? > > When maven is executed against a pom that has <module> tags, then maven > gathers together the poms for all the referenced modules, and their > submodules etc. into a big pool of poms. The dependencies for each pom > are checked, and the list of poms is reordered so that they are sorted > in the necessary order, regardless of where the modules are in the > directory structure. This process is called "the reactor". > > Then whatever command the user requested is applied over this reordered > list of poms. > > Is that correct? In essence, yes > And is that all the "reactor" does? > > And (back to the original poster's question) can the order be affected > by profiles, ie if dependencies are altered depending on what profiles > are currently active, does the reactor take that into account? Yes, if a profile adds dependencies or even additional modules, those will be taken into account. Additionally, the order can also be affected because if a plugin which is an "aggregator" plugin is bound to a phase that will be executed. An aggregator plugin is supposed to be executed only in the root pom, _after_ all the other plugins have completed execution. However, this is not quite how things work at present, and you can end up with a badly broken build if you carelessly add @aggregator plugin goals to your build. > > Thanks, > Simon > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > >