You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ivy-user@ant.apache.org by Scott Goldstein <sg...@apache.org> on 2009/05/24 04:48:03 UTC

ivy settings, include, and offline mode

In my ivysettings, I use an include tag to include an ivy settinsg file located on a file server.  When the file server is not available, I get the following message:
 
BUILD FAILED
...build.xml:14: impossible to configure ivy:settings with given file: ...\ivysettings.xml : java.text.ParseException: failed to load settings from file:/c://.../ivysettings.xml: io problem while parsing config file: \\fileserver\c\...\remoteivysettings.xml (The network path was not found)
 
I'd like the behavior to be:
1.  When online, include the file
2.  When offline, ignore the error and continue
 
Is there any way to achieve this?  
 
Thanks.
 
Scott

Re: ivy settings, include, and offline mode

Posted by Mitch Gitman <mg...@gmail.com>.
Offering a little different perspective from Geoff...

I'm presuming you're using Ivy from within Ant. In that case, remember that
you can put ${} Ant property placeholders in your ivysettings.xml file. You
should know when you're online and when you're offline, so define an Ant
property in the master ivysettings.xml file:
ivysettings.location=*real_location*

Then when you're offline, you can set this property sooner and set it to an
Ivy settings file at a local location or just a dummy ivysettings.xml.
Ideally, you would specify this "override" property in a properties file or
Ant script that does not get committed to source control.

I'm sure there's a bit slicker variation on the approach I'm describing.

Ideally, IMHO, an imported ivysettings.xml file should only be at a
remote/network location if it happens to be co-located with an Ivy
repository at that location. So if you're not able to reach the Ivy settings
file, you're also not able to reach its associated repository. And in that
case, you have to address the larger question of how to make do without that
particular repository.

On Sat, May 23, 2009 at 7:48 PM, Scott Goldstein <sg...@apache.org>wrote:

> In my ivysettings, I use an include tag to include an ivy settinsg file
> located on a file server.  When the file server is not available, I get the
> following message:
>
> BUILD FAILED
> ...build.xml:14: impossible to configure ivy:settings with given file:
> ...\ivysettings.xml : java.text.ParseException: failed to load settings from
> file:/c://.../ivysettings.xml: io problem while parsing config file:
> \\fileserver\c\...\remoteivysettings.xml (The network path was not found)
>
> I'd like the behavior to be:
> 1.  When online, include the file
> 2.  When offline, ignore the error and continue
>
> Is there any way to achieve this?
>
> Thanks.
>
> Scott

Re: ivy settings, include, and offline mode

Posted by Geoff Clitheroe <g....@gmail.com>.
Hi Scott,

I don't think you can get ivy:include to ignore this error.  You
could, I think, get the functionality that you want with 'ant copy'.
If you keep a copy of the ivysettings.xml in your project somewhere
and ivy:include that.  Then in your ant script try to copy a new
version each time and ignore any errors:

	<copy file="file:/c://.../ivysettings.xml"
tofile="${basedir}/etc/ivysettings.xml" failonerror="false"/>

We do something similar except with 'get' from a URL.

Cheers,
Geoff


On Sun, May 24, 2009 at 2:48 PM, Scott Goldstein <sg...@apache.org> wrote:
> In my ivysettings, I use an include tag to include an ivy settinsg file located on a file server.  When the file server is not available, I get the following message:
>
> BUILD FAILED
> ...build.xml:14: impossible to configure ivy:settings with given file: ...\ivysettings.xml : java.text.ParseException: failed to load settings from file:/c://.../ivysettings.xml: io problem while parsing config file: \\fileserver\c\...\remoteivysettings.xml (The network path was not found)
>
> I'd like the behavior to be:
> 1.  When online, include the file
> 2.  When offline, ignore the error and continue
>
> Is there any way to achieve this?
>
> Thanks.
>
> Scott