Ivy
  1. Ivy
  2. IVY-1346

Unnecessary warning when parent ivy.xml is located using resolvers rather than a location attribute on the extends element

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.2.0, 2.3.0-RC1
    • Fix Version/s: 2.3.0-RC2
    • Component/s: Core
    • Labels:

      Description

      When using an <extends> element without a location attribute an unnecessary warning is output stating that ../ivy.xml could not be parsed (unless there is in fact a file ../ivy.xml relative to the ivy.xml that contains the <extends>).

      For example:

      ...
          <info organisation="foo" module="bar" revision="1.0" status="integration">
              <extends organisation="foo" module="parent" revision="1.0.0" />
          </info>
      ...
      
      [ivy:resolve] Unable to parse included ivy file ../ivy.xml: D:\project\component\ivy.xml
      (The system cannot find the file specified) in file:/D:/project/component/ivy.xml
      

      XmlModuleDescriptorParser.extendsStarted() is the source of the warning. If no location was specified on the <extends> it uses a default location of ../ivy.xml. It then attempts to find and use the ../ivy.xml location, and only falls back to resolving the parent descriptor if ../ivy.xml doesn't exist or if its ModuleId is not what is expected.

      The behavior is sensible and I do not suggest that it be changed. However, it would be nice if the warning that ../ivy.xml could not be parsed were suppressed when that file is being used as a default. The warning would still be appropriate if location="../ivy.xml" were explicitly included in the <extends> element.

      1. IVY-1346.zip
        3 kB
        Matt Hurne
      2. IVY-1346.patch
        0.9 kB
        Matt Hurne

        Activity

        Hide
        Matt Hurne added a comment -

        A possible solution is attached. However, I haven't been able to test it due to IVY-1347.

        Show
        Matt Hurne added a comment - A possible solution is attached. However, I haven't been able to test it due to IVY-1347 .
        Hide
        Maarten Coene added a comment -

        I cannot reproduce this warning.
        What JDK version do you use?

        Show
        Maarten Coene added a comment - I cannot reproduce this warning. What JDK version do you use?
        Hide
        Matt Hurne added a comment -

        We are using:

        D:\>java -version
        java version "1.6.0_21"
        Java(TM) SE Runtime Environment (build 1.6.0_21-b07)
        Java HotSpot(TM) Client VM (build 17.0-b17, mixed mode, sharing)
        
        Show
        Matt Hurne added a comment - We are using: D:\>java -version java version "1.6.0_21" Java(TM) SE Runtime Environment (build 1.6.0_21-b07) Java HotSpot(TM) Client VM (build 17.0-b17, mixed mode, sharing)
        Hide
        Matt Hurne added a comment -

        An example project that produces the warning is attached (IVY-1346.zip). This project assumes that you have the Ivy JAR in ANT_HOME/lib. Simply run ant from the directory containing the build.xml, and you should see the following output:

        C:\Documents and Settings\mhurne\Desktop\IVY-1346>ant
        Buildfile: build.xml
        
        default:
        [ivy:resolve] :: Ivy 2.2.0 - 20100923230623 :: http://ant.apache.org/ivy/ ::
        [ivy:resolve] :: loading settings :: file = C:\Documents and Settings\mhurne\Desktop\IVY-1346\ivysettings.xml
        [ivy:resolve] :: resolving dependencies :: foo#child;1.0
        [ivy:resolve]   confs: [default]
        [ivy:resolve] :: resolution report :: resolve 31ms :: artifacts dl 0ms
                ---------------------------------------------------------------------
                |                  |            modules            ||   artifacts   |
                |       conf       | number| search|dwnlded|evicted|| number|dwnlded|
                ---------------------------------------------------------------------
                |      default     |   0   |   0   |   0   |   0   ||   0   |   0   |
                ---------------------------------------------------------------------
        [ivy:resolve]
        [ivy:resolve] :: problems summary ::
        [ivy:resolve] :::: WARNINGS
        [ivy:resolve]   Unable to parse included ivy file ../ivy.xml: C:\Documents and Settings\mhurne\Desktop\ivy.xml (The system cannot find the file specified) in file:/C:/Documents%20and%20Settings/mhurne/Desktop/ivy.xml
        [ivy:resolve]
        [ivy:resolve] :: USE VERBOSE OR DEBUG MESSAGE LEVEL FOR MORE DETAILS
        
        BUILD SUCCESSFUL
        Total time: 0 seconds
        Show
        Matt Hurne added a comment - An example project that produces the warning is attached ( IVY-1346 .zip). This project assumes that you have the Ivy JAR in ANT_HOME/lib. Simply run ant from the directory containing the build.xml , and you should see the following output: C:\Documents and Settings\mhurne\Desktop\IVY-1346>ant Buildfile: build.xml default: [ivy:resolve] :: Ivy 2.2.0 - 20100923230623 :: http://ant.apache.org/ivy/ :: [ivy:resolve] :: loading settings :: file = C:\Documents and Settings\mhurne\Desktop\IVY-1346\ivysettings.xml [ivy:resolve] :: resolving dependencies :: foo#child;1.0 [ivy:resolve] confs: [default] [ivy:resolve] :: resolution report :: resolve 31ms :: artifacts dl 0ms --------------------------------------------------------------------- | | modules || artifacts | | conf | number| search|dwnlded|evicted|| number|dwnlded| --------------------------------------------------------------------- | default | 0 | 0 | 0 | 0 || 0 | 0 | --------------------------------------------------------------------- [ivy:resolve] [ivy:resolve] :: problems summary :: [ivy:resolve] :::: WARNINGS [ivy:resolve] Unable to parse included ivy file ../ivy.xml: C:\Documents and Settings\mhurne\Desktop\ivy.xml (The system cannot find the file specified) in file:/C:/Documents%20and%20Settings/mhurne/Desktop/ivy.xml [ivy:resolve] [ivy:resolve] :: USE VERBOSE OR DEBUG MESSAGE LEVEL FOR MORE DETAILS BUILD SUCCESSFUL Total time: 0 seconds
        Hide
        Matt Hurne added a comment -

        Is there anything more I can do to help resolve this issue?

        Show
        Matt Hurne added a comment - Is there anything more I can do to help resolve this issue?
        Hide
        Maarten Coene added a comment -

        Sorry, I didn't had the time to look into this issue yet.
        But it will get fixed before the final 2.3.0 release.

        Show
        Maarten Coene added a comment - Sorry, I didn't had the time to look into this issue yet. But it will get fixed before the final 2.3.0 release.
        Hide
        Matt Hurne added a comment -

        No problem, Maarten. I'm sure you're busy! Thanks for the update.

        Show
        Matt Hurne added a comment - No problem, Maarten. I'm sure you're busy! Thanks for the update.
        Hide
        Maarten Coene added a comment -

        I think this is fixed in trunk, but since I couldn't reproduce the problem, could you please give it a try to see if the warning has disappeared?

        Show
        Maarten Coene added a comment - I think this is fixed in trunk, but since I couldn't reproduce the problem, could you please give it a try to see if the warning has disappeared?
        Hide
        Matt Hurne added a comment -

        Thanks, Maarten. I have since moved on from the project and am no longer in a position to test this personally.

        Show
        Matt Hurne added a comment - Thanks, Maarten. I have since moved on from the project and am no longer in a position to test this personally.

          People

          • Assignee:
            Maarten Coene
            Reporter:
            Matt Hurne
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development