You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ivy-commits@incubator.apache.org by "Xavier Hanin (JIRA)" <ji...@apache.org> on 2007/03/26 09:51:32 UTC

[jira] Resolved: (IVY-448) Conflict managers ignored, when assigned to modules in Ivy configuration (setting, ivyconf.xml)

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

Xavier Hanin resolved IVY-448.
------------------------------

       Resolution: Fixed
    Fix Version/s: 1.5

I've added a junit test and fixed the problem with a solution very similar to what you suggested. Good analyze, thanks again!

> 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
>         Assigned To: Xavier Hanin
>            Priority: Minor
>             Fix For: 1.5
>
>
> 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.
> And Ivy.getConflictManager(ModuleId) is not called from anywhere.
> 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.