Ivy
  1. Ivy
  2. IVY-437

setting m2compatible on ibiblio resolver overwrite root and pattern settings

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.4.1
    • Fix Version/s: 2.0-RC1
    • Component/s: None
    • Labels:
      None

      Description

      Setting m2compatible="true" on an ibiblio resolver overwrites the root and pattern settings, even if they were set manually. Depending on the order of attributes and the xml parser used, the result is varying (if setM2compatible is called before setRoot, the configured root will be used, otherwise it's the default value for m2compatible which will be used!

        Issue Links

          Activity

          Xavier Hanin created issue -
          Xavier Hanin made changes -
          Field Original Value New Value
          Assignee Xavier Hanin [ xavier ]
          Hide
          Xavier Hanin added a comment -

          Updated junit test and fixed the problem. Now the manual settings will be used even if setM2compatible is called after setRoot or setPattern

          Show
          Xavier Hanin added a comment - Updated junit test and fixed the problem. Now the manual settings will be used even if setM2compatible is called after setRoot or setPattern
          Xavier Hanin made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          Xavier Hanin made changes -
          Link This issue is duplicated by IVY-460 [ IVY-460 ]
          Xavier Hanin made changes -
          Fix Version/s 2.0 [ 12312237 ]
          Fix Version/s 2.0.0-alpha-1 [ 12312472 ]
          Hide
          Jing Xue added a comment -

          Actually, I'm not sure this is fixed. Now (as of r555145) the configured value is ignored when setM2compatible is called before others. 8-)

          This was discovered when I tried to build the latest ivy trunk code, and because ivysettings.xml is no longer used, I added ivy.ibiblio.default.artifact.root to build.properties, which apparently didn't take an effect.

          I'm attaching a patch to IBiblioResolver.java that appears to fix the problem - at least I'm able to build the trunk with it.

          Show
          Jing Xue added a comment - Actually, I'm not sure this is fixed. Now (as of r555145) the configured value is ignored when setM2compatible is called before others. 8-) This was discovered when I tried to build the latest ivy trunk code, and because ivysettings.xml is no longer used, I added ivy.ibiblio.default.artifact.root to build.properties, which apparently didn't take an effect. I'm attaching a patch to IBiblioResolver.java that appears to fix the problem - at least I'm able to build the trunk with it.
          Jing Xue made changes -
          Attachment m2root_override.patch [ 12361605 ]
          Hide
          Maarten Coene added a comment -

          I'm reopening this for further investigation

          Show
          Maarten Coene added a comment - I'm reopening this for further investigation
          Maarten Coene made changes -
          Resolution Fixed [ 1 ]
          Assignee Xavier Hanin [ xavier ]
          Status Resolved [ 5 ] Reopened [ 4 ]
          Xavier Hanin made changes -
          Fix Version/s 2.0 [ 12312237 ]
          Xavier Hanin made changes -
          Assignee Xavier Hanin [ xavier ]
          Hide
          Xavier Hanin added a comment -

          I've applied your patch, with slight modifications. It should work properly now. Thanks a lot for your contribution.

          Show
          Xavier Hanin added a comment - I've applied your patch, with slight modifications. It should work properly now. Thanks a lot for your contribution.
          Xavier Hanin made changes -
          Fix Version/s 2.0.0-alpha-1 [ 12312472 ]
          Resolution Fixed [ 1 ]
          Fix Version/s 2.0-RC1 [ 12313012 ]
          Status Reopened [ 4 ] Resolved [ 5 ]
          Fix Version/s 2.0 [ 12312237 ]
          Hide
          Xavier Hanin added a comment -

          I had to mostly revert the changes, the problem is that by overriding the root value when the default one is used in ensureConfigured make the default value never actually used. But now that I think more about that, I'm not sure to understand what the problem is supposed to be with current implementation. Jing, could you tell us more about what you want to achieve, and what goes wrong?

          Show
          Xavier Hanin added a comment - I had to mostly revert the changes, the problem is that by overriding the root value when the default one is used in ensureConfigured make the default value never actually used. But now that I think more about that, I'm not sure to understand what the problem is supposed to be with current implementation. Jing, could you tell us more about what you want to achieve, and what goes wrong?
          Hide
          Jing Xue added a comment -

          I could be wrong, but if setM2compatible is called before ensureConfigured, root will be set to DEFAULT_M2_ROOT, and the part reading from ivy.ibiblio.default.artifact.root in ensureConfigured will never get executed. And I think whether setM2compatible will be called before or after any other setters really just depends on the order of attributes in the settings file.

          Show
          Jing Xue added a comment - I could be wrong, but if setM2compatible is called before ensureConfigured, root will be set to DEFAULT_M2_ROOT, and the part reading from ivy.ibiblio.default.artifact.root in ensureConfigured will never get executed. And I think whether setM2compatible will be called before or after any other setters really just depends on the order of attributes in the settings file.

            People

            • Assignee:
              Xavier Hanin
              Reporter:
              Xavier Hanin
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development