If M is the parent of A and B, then A and B both depend on M,
therefore M must be build first.

If A and B do not use M as their parent, then, AFAIK, A and B are
children so will be built first.

AFAIK, maven will try to build modules in the order they are declared,
unless dependencies override that, so if A depended on B then the
build order would be B A M... if B did not have M as a parent, A
depended on B and has M as a parent, I think the build order should be
B M A but could (at Maven's choice) be M B A.

Think of it as being just like the JVM between synchronization points.
 As long as the outcome is the same, the JVM is free to reorder
operations as it sees fit.... even if this breaks what you intended...
(I may have got  this example slightly wrong as every developer on
site is reading Java Concurrency in Practice and our copy currently is
at large!)

boolean flag = false;
Integer value = null;
Thread t = new Thread() {
  public void run() {
    if (flag) System.out.println(value.toString());
  }
};
value = Integer.valueOf(5);
flag = true;
t.start()

Can validly print out:
* Nothing,
* NullPointerException
* 5

depending on the JVM and the machine you are running on. If this
scares you, read the excellent book Java Concurrency In Practice and
you'll realise everything you thought you knew about multi-threading
is wrong! (I know I did)

-Stephen

On Dec 11, 2007 9:12 AM, Jeff MAURY <[EMAIL PROTECTED]> wrote:
> Hello,
>
> I have the following problem:
> A multi module POM (called M) has tow modules A and B.
> If I run Maven on M, then the execution order is A,B and M.
>
> Now, let assume that M is the parent of A and B.
> The execution order is changed to M,A and B
> This causes me some trouble because I want to run plugins when M is builded
> that need to get stuff from A and B in the local repository.
> Another case is that you want to generated Javadoc with M and A or B cause
> generation of source files : if M is executed before A and B, then the
> Javadoc may be incomplete !!!
>
> Does everyone has experienced the same problem and is it a Maven bug or a
> Maven feature ?
>
> Thanks
> Jeff
>
>
> --
> La mélancolie c'est communiste
> Tout le monde y a droit de temps en temps
> La mélancolie n'est pas capitaliste
> C'est même gratuit pour les perdants
> La mélancolie c'est pacifiste
> On ne lui rentre jamais dedans
> La mélancolie oh tu sais ça existe
> Elle se prend même avec des gants
> La mélancolie c'est pour les syndicalistes
> Il faut juste sa carte de permanent
>
> Miossec (2006)
>
> http://www.jeffmaury.com
> http://riadiscuss.jeffmaury.com
>

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

Reply via email to