IvyDE
  1. IvyDE
  2. IVYDE-318

Incomplete variable substitution for ivysettings.xml

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.2.0.beta1
    • Fix Version/s: 2.2.0.final
    • Component/s: classpath container
    • Labels:
      None
    • Environment:

      Eclipse Helios

      Description

      I'm getting an error which shows up on the IvyDE Managed Libraries screen, the Settings tab on the Ivy Setting Path. It says "Parsing error of the Ivy Settings". My ivysettings.xml file works fine in my ant/ivy level build.

      It appears that the properties defined in the property files also listed on this Settings tab are not used to do variable substitution on my Ivy settings file for the <classpath> tag definitions within it. It appears that only the ivy.settings.dir property is actually substituted. See the IvySettingsFile.java substitute method

      private String substitute(String str) {
      Map variables = new HashMap();
      if (file.getParentFile() != null)

      { URI settingsDirUri = file.getParentFile().toURI(); variables.put("ivy.settings.dir", settingsDirUri.toString()); }

      return IvyPatternHelper.substituteVariables(str, variables);
      }

      This needs to allow for the full set of properties configured via the associated properties files for these settings to be part of this variable substitution.

        Activity

        Hide
        Nicolas Lalevée added a comment -

        Nothing has been discussed. Maybe within a month or two I'll get to do one.

        Show
        Nicolas Lalevée added a comment - Nothing has been discussed. Maybe within a month or two I'll get to do one.
        Hide
        Daniel Holmes added a comment -

        I downloaded the trunk and my issue appears to be resolved. Thanks a lot. Is there info on next expected release?

        Show
        Daniel Holmes added a comment - I downloaded the trunk and my issue appears to be resolved. Thanks a lot. Is there info on next expected release?
        Hide
        Nicolas Lalevée added a comment -

        Maybe it has been already fixed, I was testing with the trunk version. Maybe you could give a try ?
        There is an updatesite there http://builds.apache.org/job/IvyDE-updatesite/lastSuccessfulBuild/artifact/trunk/build

        Show
        Nicolas Lalevée added a comment - Maybe it has been already fixed, I was testing with the trunk version. Maybe you could give a try ? There is an updatesite there http://builds.apache.org/job/IvyDE-updatesite/lastSuccessfulBuild/artifact/trunk/build
        Hide
        Daniel Holmes added a comment - - edited

        Are you saying the error is just that this caused an invalid error marker? I'm not sure that is the whole issue.

        I can't seem to have my filesystem resolver work unless I only have the ivy.settings.dir property. Using other properties in that pattern do not seem to allow the resolution to happen.

        Show
        Daniel Holmes added a comment - - edited Are you saying the error is just that this caused an invalid error marker? I'm not sure that is the whole issue. I can't seem to have my filesystem resolver work unless I only have the ivy.settings.dir property. Using other properties in that pattern do not seem to allow the resolution to happen.
        Hide
        Nicolas Lalevée added a comment -

        Actually, the error was incorrectly displayed, the properties were not loaded in the settings tab. If you do close the setup even with the error marker, the classpath will be properly computed.
        I fixed the update of the error marker. Thanks for reporting the bug.

        Show
        Nicolas Lalevée added a comment - Actually, the error was incorrectly displayed, the properties were not loaded in the settings tab. If you do close the setup even with the error marker, the classpath will be properly computed. I fixed the update of the error marker. Thanks for reporting the bug.
        Hide
        Daniel Holmes added a comment -

        Also seeing the same issue within my <filesystem> resolver

        <filesystem name="depot">
        <ivy pattern="$

        {foo}/[organisation]/[module]/[revision]/ivy-[module]-[revision].xml" />
        <artifact pattern="${foo}

        /[organisation]/[module]/[revision]/[artifact].[ext]" />
        <artifact pattern="$

        {foo}

        /[organisation]/[module]/[revision]/[artifact]-[revision].[ext]" />
        </filesystem>

        vs

        <filesystem name="depot">
        <ivy pattern="$

        {ivy.settings.dir}/[organisation]/[module]/[revision]/ivy-[module]-[revision].xml" />
        <artifact pattern="${ivy.settings.dir}

        /[organisation]/[module]/[revision]/[artifact].[ext]" />
        <artifact pattern="$

        {ivy.settings.dir}

        /[organisation]/[module]/[revision]/[artifact]-[revision].[ext]" />
        </filesystem>

        Show
        Daniel Holmes added a comment - Also seeing the same issue within my <filesystem> resolver <filesystem name="depot"> <ivy pattern="$ {foo}/ [organisation] / [module] / [revision] /ivy- [module] - [revision] .xml" /> <artifact pattern="${foo} / [organisation] / [module] / [revision] / [artifact] . [ext] " /> <artifact pattern="$ {foo} / [organisation] / [module] / [revision] / [artifact] - [revision] . [ext] " /> </filesystem> vs <filesystem name="depot"> <ivy pattern="$ {ivy.settings.dir}/ [organisation] / [module] / [revision] /ivy- [module] - [revision] .xml" /> <artifact pattern="${ivy.settings.dir} / [organisation] / [module] / [revision] / [artifact] . [ext] " /> <artifact pattern="$ {ivy.settings.dir} / [organisation] / [module] / [revision] / [artifact] - [revision] . [ext] " /> </filesystem>
        Hide
        Daniel Holmes added a comment -

        basically I have a custom conflict manager that I'm configuring
        and I need a classpath entry for the jar file. If I colocate with the ivysettings file and do

        <classpath file="$

        {ivy.settings.dir}

        /company-ivy.jar"/>
        <typedef name="strict-with-force" classname="com.company.common.ivy.StrictWithForceConflictManager"/>
        <conflict-managers>
        <strict-with-force name="strict-with-force"/>
        </conflict-managers>

        it loads file, but if I instead use

        <classpath file="$

        {foo}/company-ivy.jar"/>

        and in a property file (build-local.properties) have

        foo=<path to jar>

        and this entry in my .classpath file
        <classpathentry kind="con" path="org.apache.ivyde.eclipse.cpcontainer.IVYDE_CONTAINER/?project=foo&ivyXmlPath=ivy.xml&confs=*&ivySettingsPath=file%3AU%3A%2Fp4%2Fbard%2Faxx%2Faxx-ivysettings.xml&loadSettingsOnDemand=false&propertyFiles=U%3A%2Fp4%2Fbard%2Fbuild-local.properties&acceptedTypes=jar%2Cbundle%2Cejb%2Cmaven-plugin&alphaOrder=false&resolveInWorkspace=true&retrievedClasspath=false"/>

        it seems this ${foo}

        in the classpath entry is not replaced, cause an exception of classloading which is the reason for the parse loading error I see. I can toggle between the 2 different <classpath> items above, refresh in eclipse and have the warning appear and go away.

        Show
        Daniel Holmes added a comment - basically I have a custom conflict manager that I'm configuring and I need a classpath entry for the jar file. If I colocate with the ivysettings file and do <classpath file="$ {ivy.settings.dir} /company-ivy.jar"/> <typedef name="strict-with-force" classname="com.company.common.ivy.StrictWithForceConflictManager"/> <conflict-managers> <strict-with-force name="strict-with-force"/> </conflict-managers> it loads file, but if I instead use <classpath file="$ {foo}/company-ivy.jar"/> and in a property file (build-local.properties) have foo=<path to jar> and this entry in my .classpath file <classpathentry kind="con" path="org.apache.ivyde.eclipse.cpcontainer.IVYDE_CONTAINER/?project=foo&ivyXmlPath=ivy.xml&confs=*&ivySettingsPath=file%3AU%3A%2Fp4%2Fbard%2Faxx%2Faxx-ivysettings.xml&loadSettingsOnDemand=false&propertyFiles=U%3A%2Fp4%2Fbard%2Fbuild-local.properties&acceptedTypes=jar%2Cbundle%2Cejb%2Cmaven-plugin&alphaOrder=false&resolveInWorkspace=true&retrievedClasspath=false"/> it seems this ${foo} in the classpath entry is not replaced, cause an exception of classloading which is the reason for the parse loading error I see. I can toggle between the 2 different <classpath> items above, refresh in eclipse and have the warning appear and go away.
        Hide
        Nicolas Lalevée added a comment -

        Could you share your ivysettings.xml and you properties file ? I would help a lot debugging it.

        Show
        Nicolas Lalevée added a comment - Could you share your ivysettings.xml and you properties file ? I would help a lot debugging it.

          People

          • Assignee:
            Nicolas Lalevée
            Reporter:
            Daniel Holmes
          • Votes:
            4 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development