<project name="foo" default="foo" basedir="."
   xmlns:ivy="antlib:org.apache.ivy.ant">

  <target name="foo">
    <ivy:settings file="ivyconf.xml" id="settings1" />
  </target>

  <target name="bar">
    <ivy:settings file="ivysettings.xml" id="settings1" override="true"/>

    <ivy:cachepath pathid="mypath"
                   settingsRef="settings1" 
                   inline="true"
                   organisation="apache"
                   module="commons-lang"
                   revision="2.3" />
  </target>

</project>
