I notices an unexpected thing about plugin execution order: If I have
several plugins running in the same phase, normally they are executed in
the lexical order in which they appear in the POM. But there is a case
in which this can change. Schematically, it looks like this:

<profiles>
  <profile P>
    <build>
      <plugins>
        <plugin A, phase X />
      </plugins>
    </build>
  </profile P>
</profiles>

<build>
  <plugins>
    <plugin B, phase X />
  </plugins>
</build>

My expectation was that the execution order in phase X would be plugin
A, then B. This is true sometimes, depending on which build other
profiles are active. I mean completely unrelated profiles defined in
other Maven modules. In my specific case, without specifying any other
profiles (P is auto-activated bases on non-existence of a file), the
order was B, A. If I manually activated any other profile or
de-activated a profile which otherwise would be active automatically,
the order changed to A, B.

In my case, I had the option of moving plugin B to a later phase, which
settled the issue for me, but that is not always possible.

Can anybody enlighten me on what is happening here and if this behaviour
is documented anywhere? Or is this just the "read the freakin' source
code, pal" kind of detail?

-- 
Alexander Kriegisch
https://scrum-master.de

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org

Reply via email to