On Mon, Dec 28, 2009 at 12:59 PM, Guido Spadotto <[email protected]>wrote:

> Hi Justin,
> thanks for your hint.
>
> So, if I specify the versions I require the whole project to use in the
> "pluginManagement" section of my
> parent pom P, will that be enough to avoid this
> "first-version-found-is-always-used" policy (better: to use
> that policy so that the version I need is picked up and used throughout the
> modules)?
>
> Or do I still have to hunt for occurrences of the dependency *and* version
> in the pom files of modules
> A, B, ... ?

To be on the safe side, put the desired versions inside pluginManagement in
your parent pom and *remove* any versions from the modules. But, to be
clear, it's a plugin, not a dependency (it's not a problem to specify
different versions of the same dependency within a multi-module build).

I'm pretty sure that, in my example, if P specifies version 1.1.0 in
pluginManagement, it still won't change things because module A overrides
this information with an explicit version and P didn't actually load the
plugin. But even if it did, that'd still be bad because you would have a
different plugin version when running Maven from P than you would when
running Maven from A.

So the best thing to do is to only specify plugin versions in the parent,
using either the plugins or pluginManagement elements.

Justin

Reply via email to