[ http://jira.codehaus.org/browse/MNG-1577?page=comments#action_79216 ] Ralph Goers commented on MNG-1577: ----------------------------------
Mike, I suspect the behavior you are reporting is not part of the patch, but is part of how the pom's extend each other. In other words, I believe you will find that you get the same behavior without this patch applied. As part of my debugging I've noticed that every project that inherits from a parent has the dependencyManagement of its parent (plus whatever managed dependencies it introduces, if any). At first I was surprised by this but after thinking about it it made sense to me. However, since the code in my patch is simply taking the dependencyManagement that is provided and then is creating a ManagedVersionMap I've never investigated as to whether the dependencyManagement object was created correctly. I've noticed other behaviors that are a bit odd. While trying to create unit tests I noticed that if a dependency did not have a version then all dependency versions in that project seemed to be overridden from the dependencyManagement version. If all dependencies had a version then none of the dependencies were overridden. I was only expecting the one dependency to have been affected. I'll be happy to go on and try to figure out how to fix the behavior you've noted, but I don't think it should keep the patch from being applied as it is since I don't think it is breaking anything that isn't already broken. In fact, I've tried to keep all the broken behavior intact with override set to false in order to maintain backward compatibility. > dependencyManagement does not work for transitive dependencies > -------------------------------------------------------------- > > Key: MNG-1577 > URL: http://jira.codehaus.org/browse/MNG-1577 > Project: Maven 2 > Issue Type: Bug > Components: Artifacts and Repositories > Affects Versions: 2.0 > Reporter: Joerg Schaible > Fix For: 2.1 > > Attachments: mng1577.patch, mng1577a.patch, mng1577b.patch, > mng1577c.patch, mng1577d.patch, mng1577trunk.patch > > > The dependencyManagement does not work for transient dependencies. The > specified version is ignored. > Use case: > Main POM defines commons-digester-1.6 and commons-beanutils-1.7.0, A-SNAPSHOT > and B-SNAPSHOT > Project A is child of Main and depends directly on commons-beanutils (version > inherited from Main) > Project B is child of Main and depends directly on commons-digester (version > inherited from Main) > Project C is child of Main and depends directly on A & B (versions inherited > from Main) > A is compiled and tests are run using commons-beanutils-1.7.0 > B is compiled and tests are run using commons-digester-1.6 and > commons-beanutils-1.6, since digester is dependend on this > C is compiled and tests are run using commons-beanutils-1.7.0 > Integration tests of B did not verify, that B is behaving as expected in this > scenario. B might fail with 1.7.0 and it is not even recognized. > If I add beanutils also as direct dependency to B, it works fine, but then > are transitive dependency useless. It should be possible to define at least > in the dependencyManagement, that the versions of transient dependencies also > defined in the dependencyManagement have priority. > - Jörg -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira