Ivy
  1. Ivy
  2. IVY-1162

ivy.settings.dir space escaping problem

    Details

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

      Description

      When an ivysettings file is included from a path with spaces in it, the ivy.settings.dir property becomes doubly escaped. I run into this problem when trying to configure the ivy classpath. This is causing a lot of pain for our team members using windows since they want to keep everything under their home directory which includes spaces in the path due to the "C:\Documents and Settings" directory. I'll be attaching a testcase which throws an exception when "java -jar ivy-2.1.0.jar -settings ivysettings.xml" is called. The exception root cause is:

      Caused by: java.lang.RuntimeException: impossible to define new type: class not found: Foo in file:/tmp/x/dir%2520with%2520spaces/foo.jar nor Ivy classloader
      at org.apache.ivy.core.settings.IvySettings.classForName(IvySettings.java:648)
      at org.apache.ivy.core.settings.IvySettings.typeDef(IvySettings.java:632)
      at org.apache.ivy.core.settings.IvySettings.typeDef(IvySettings.java:628)
      at org.apache.ivy.core.settings.XmlSettingsParser.typedefStarted(XmlSettingsParser.java:503)
      at org.apache.ivy.core.settings.XmlSettingsParser.startElement(XmlSettingsParser.java:205)
      at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:504)
      at com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocumentParser.emptyElement(AbstractXMLDocumentParser.java:182)
      at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScannerImpl.java:1315)
      at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2723)
      at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:624)
      at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:486)
      at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:810)
      at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:740)
      at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:110)
      at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1208)
      at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:525)
      at javax.xml.parsers.SAXParser.parse(SAXParser.java:392)
      at javax.xml.parsers.SAXParser.parse(SAXParser.java:274)
      at org.apache.ivy.core.settings.XmlSettingsParser.doParse(XmlSettingsParser.java:160)
      ... 23 more

      1. ivybug.zip
        2 kB
        Geoff Reedy

        Activity

        Hide
        Geoff Reedy added a comment -

        This test case demonstrates the problem. Unzip it and run java -jar ivy-2.1.0.jar -settings ivysettings.xml in the "dir with spaces" directory.

        Show
        Geoff Reedy added a comment - This test case demonstrates the problem. Unzip it and run java -jar ivy-2.1.0.jar -settings ivysettings.xml in the "dir with spaces" directory.
        Hide
        Maarten Coene added a comment -

        Fixed in SVN trunk. Could you give it a try?
        In addition, if you use the trunk version, you don't have to use the $

        {ivy.settings.dir}

        property any longer, you can simply do:

        <ivysettings>
          <classpath file="foo.jar"/>
          <typedef name="foo" classname="Foo"/>
        </ivysettings>
        

        Maarten

        Show
        Maarten Coene added a comment - Fixed in SVN trunk. Could you give it a try? In addition, if you use the trunk version, you don't have to use the $ {ivy.settings.dir} property any longer, you can simply do: <ivysettings> <classpath file="foo.jar"/> <typedef name="foo" classname="Foo"/> </ivysettings> Maarten
        Hide
        Alexandre Gacon added a comment -

        I got the same problem and I can confirm you that all works fine with the trunk version.

        Alexandre

        Show
        Alexandre Gacon added a comment - I got the same problem and I can confirm you that all works fine with the trunk version. Alexandre

          People

          • Assignee:
            Maarten Coene
            Reporter:
            Geoff Reedy
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development