incubator-ivy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Eric Crahen (JIRA)" <>
Subject [jira] Created: (IVY-361) Please add option for ivy:configure to cache remote files for diconnected development
Date Sun, 24 Dec 2006 05:53:20 GMT
Please add option for ivy:configure to cache remote files for diconnected development

                 Key: IVY-361
             Project: Ivy
          Issue Type: Improvement
          Components: Core
    Affects Versions: 1.4.1
         Environment: All
            Reporter: Eric Crahen

(see the ivy-user@ archive for the complete discussion under the Disconnected Development

Doing disconnected development with an ivyconfig.xml that is stored on a server somewhere
is quite a challenge. ivy:configure will fail immediately 
when you use the url property and the network is unavailable. One way to get around this is
to use an ant build file like this:

<?xml version="1.0" encoding="utf-8"?>
 This is an expirement with creating a disconnected development
 build. We still keep configuration in a central location, but
 work from a local cache. As long as you build once connected,
 you should be able to run disconnected.

  <!-- Prepare the location of the local cache of the remote file -->
  <property name="ivy.config.cache" value="${user.home}${file.separator}.ivy${file.separator}config${file.separator}"/>
  <property name="ivy.config.xml" value="http://myserver/ivyconf.xml"/>

  <!-- Convert the URL to a safe filename -->
  <pathconvert property="">
    <path path="${file.separator}${ivy.config.xml}"/>
      <replacestring from="${file.separator}" to="_"/>

  <!-- The local cached file name -->
  <property name="ivy.config.cache.xml" value="${ivy.config.cache}${}"/>
  <mkdir dir="${ivy.config.cache}"/>

  <!-- Start a background task to update the local cache -->
  <parallel threadCount="1">
      <get src="${ivy.config.xml}" dest="${ivy.config.cache.xml}" ignoreerrors="true" usetimestamp="true"/>

  <!-- Wait for the local file to appear in the cache -->
  <waitfor maxwait="3" maxwaitunit="second">
    <available file="${ivy.config.cache.xml}"/>

  <!-- Fail the build if the remote config file could not be obtained and was not cached
    <condition><not><available file="${ivy.config.cache.xml}"/></not></condition>

  <ivy:configure file="${ivy.config.cache.xml}"/>


Which is quite a bit of ant build logic. If ivy:configure could simply cache the last known

copy of a remote file this could be reduced to :

<?xml version="1.0" encoding="utf-8"?>

  <ivy:configure useCache="true" url="http://myserver/ivyconf.xml"/>


which I think is a huge benefit to the end user. And makes getting to a disconnected build
using ivy one step simpler for those who use a centralized ivyconfig.xml

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
For more information on JIRA, see:


View raw message