Ralph Goers wrote:

No. If you reference a transitive dependency than the dependencyManagement of its parent will be used to provide the version. However, if the project being built defines the dependency, either in its pom or in a parent's dependencyManagement, than that will be used instead.

...

I don't think any of these options is desired. Our main goal should be to keep our own dependency tree as clean as possible, ie <exclude> transitive dependencies in 3rd party libs that are clearly wrong/optional etc.
Have you looked at the dependency analysis report? It is a mess.

...

Example: say i have a webapp pom that includes
- cocoon-core (which has CL 1.1)
- cocoon-thread-impl (which has CL 1.0.4)

then maven will just select CL 1.1 for inclusion, not both. If i however define in my webapp pom CL 1.0.4 then it will select only that.
Wrong. Maven will choose the "nearest" which might be 1.1 or 1.0.4. The bottom line is you can never be sure. dependencyManagement allows you to define what versions should be used wherever they appear in the project.


Gosh and i thought maven was supposed to make dependencyManagement easy :-)


Jorg

(i stand corrected on all points btw, thanks for explaining the details)

Reply via email to