[
https://issues.apache.org/jira/browse/IVY-616?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12544558
]
Xavier Hanin commented on IVY-616:
----------------------------------
Thanks a lot for this contribution Jim!
For the problem of contextual resolver, I think we should improve Ivy to push
the current resolve in IvyContext as long as other contextual data during
dependency resolution, it would at least help make some methods less ugly (like
the methods having 8 or so parameters), and would help you get the current
resolver. But even without that, we could use the same way to get the resolver
as Ivy resolve engine do: use the IvySettings#getResolver(ModuleId) method with
the module if of the parent pom.
Now some comments about your patch:
* You happen to parse the parent pom only when you find a dependency with no
revision, and only to find dependency management information. This is already
very nice, but I think I would have parsed the parent pom as soon as we find a
parent pom is declared, and try to parse not only the dependency management
section but also the rest (for inheritance), thus reusing the
PomModuleDescriptorParser
* your method to find the parent pom is heavily relying on the resolver kind
(ibiblio supported only). I understand it isn't easy to make something generic,
and maybe people will never use another resolver than ibiblio for accessing
maven 2 modules, but it's a limitation we must consider before applying the
patch
* why is the DependencyManagement class only a utility class with static
methods? I don't like static methods much, and feel like this could be a set of
methods in the PomModuleDescriptorParser, or maybe an instance to which
PomModuleDescriptorParser delegates work. But this is a minor remark, and
probably a matter of taste
* do you have some unit tests to contribute too?
Anyway, good work, thanks again!
> Maven Dependency Management is not used to determine artifact version
> ---------------------------------------------------------------------
>
> Key: IVY-616
> URL: https://issues.apache.org/jira/browse/IVY-616
> Project: Ivy
> Issue Type: Improvement
> Components: Core
> Affects Versions: 2.0.0-alpha-2
> Reporter: Jim Bonanno
> Fix For: 2.0.0-beta-1
>
> Attachments: patch.txt
>
>
> We recently hit an issue with resolving some POMs with the ibiblio resolver
> and usepoms=true. The problem is that the version for a dependency can be
> stored in the dependency management section of a parent POM.
> The apache directory server is an example.
> http://repo1.maven.org/maven2/org/apache/directory/server/apacheds-server-main/1.5.0/apacheds-server-main-1.5.0.pom
> Note that the POM for the parent build artifact has the version information
> for the last 5 dependencies.
> The PomModuleDescriptorParser currently only builds a dependency descriptor
> if the groupId, artifactId and version are all set. So for the case of apache
> directory server, many of the transitive dependencies are ignored.
> I have been working on an extension to the PomModuleDescriptorParser that
> build the dependency management information at the end of the project/parent
> element by parsing the parent chain. Then if a dependency is found without a
> version, then the dependency management information is used. I attach the
> patch after some more testing.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.