سؤال

I have an ant/ivy project that I'm also using in Eclipse. The problem is that in eclipse, ivyde is complaining about the FileResolver in my ivysettings.xml, claiming that the path must be absolute. The reason, I believe, is that it's failing to evaluate an environment variable.

The following is my ivysettings.xml file, which ivyde fails to parse due to this absolute path requirement:

<ivysettings>
  <properties environment="env"/>
  <properties file="./ivysettings.properties"/>
  <settings defaultResolver="chain"/>
  <resolvers>
    <filesystem name="local">
      <ivy pattern="${repository.dir}/[module]/ivy.xml" />
      <artifact pattern="${repository.dir}/[module]/[artifact].[ext]" />
    </filesystem>
    <chain name="chain">
       <resolver ref="local"/>
       <ibiblio name="maven2" m2compatible="true"/>
    </chain>
  </resolvers>
  <modules>
    <module organisation="org.example" resolver="local"/>
  </modules>
</ivysettings>

ivysettings.properties contains:

repository.dir=${env.githome}/metademo/ivy_build/repository

Ant is happy with this, but ivyde doesn't seem to resolve {$env.githome}. I need some way to do this 'absolute path' requirement for the FileSystem resolver for different developer environments... so using a environment variable to reference it. How do I get ivyde to recognize this?

هل كانت مفيدة؟

المحلول

In order to make a config work in different environment like Ant or Eclipse, it should be independent of any external variables. The ivysettings.xml file and property files should be sufficient to resolve any path.

Here you have set env.* properties via Ant. You should better let Ivy do it itself with the properties and its environmentattribute.

cf http://ant.apache.org/ivy/history/latest-milestone/settings/properties.html

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top