[ 
https://issues.apache.org/jira/browse/IVY-448?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12484082
 ] 

Xavier Hanin commented on IVY-448:
----------------------------------

Thanks a lot for this very detailed bug report.

I'm surprised such a bug is present and not reported yet in Ivy 1.4.1, it seems 
that this kind of settings is not used very often.

> Conflict managers ignored, when assigned to modules in Ivy configuration 
> (setting, ivyconf.xml)
> -----------------------------------------------------------------------------------------------
>
>                 Key: IVY-448
>                 URL: https://issues.apache.org/jira/browse/IVY-448
>             Project: Ivy
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.4.1
>            Reporter: John Rasmussen
>            Priority: Minor
>
> Only conflict managers assigned in the module description (ivy.xml) are used.
> Conflict managers assigned in the ivy configuration (setting, ivyconf.xml) 
> are ignored.
> See 
> https://svn.apache.org/repos/asf/incubator/ivy/core/trunk/src/java/org/apache/ivy/core/resolve/IvyNode.java
>     public ConflictManager getConflictManager(ModuleId mid) {
>         if (_md == null) {
>             throw new IllegalStateException("impossible to get conflict 
> manager when data has not been loaded");
>         }
>         ConflictManager cm = _md.getConflictManager(mid);
>         return cm == null ? _settings.getDefaultConflictManager() : cm;
>     }
> If no matching conflict manager is found in the module description then the 
> default conflict manager is returned.
> I suppose the last line should be:
>         return cm == null ? _data.getIvy().getConflictManager(mid) : cm;
> This will also return the default conflict manager if no matching conflict 
> managers are found in the ivy configuration.
> Please note (for source base 1.4.1):
> Ivy.getConflictManager(ModuleId) is the only method to call
> Ivy.getConflictManager(String) which is the only method to access 
> _conflictsManager.
> Thus conflict managers assigned in ivyconf.xml cannot be accessed in source 
> base 1.4.1.
> The Ivy configuration (setting) is as follows (parts are removed)
> <ivyconf>
>     <typedef name="my-latest-strategy" classname="..."/>
>     <latest-strategies>
>         <my-latest-strategy/>
>     </latest-strategies>
>     <conflict-managers>
>         <latest-cm name="my-latest-strategy" latest="my-latest-strategy"/>
>     </conflict-managers>
>     <modules>
>         <module organisation="my-org" name=".*" resolver="..." 
> conflict-manager="my-latest-strategy"/>
>     </modules>
> </ivyconf>
> Also:
> https://svn.apache.org/repos/asf/incubator/ivy/core/trunk/src/java/org/apache/ivy/plugins/conflict/LatestConflictManager.java
> The method toString() can return null. This is seen when the conflict manager 
> is assigned as the default conflict manager in the debug output.
> I suppose the method should be:
>     public String toString() {
>         return String.valueOf(getStrategy());
>     }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to