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 JOSE L MARTINEZ-AVIAL <jl...@gmail.com> on 2013/12/10 01:48:21 UTC

Using same ivy-settings.xml in Eclipse with IvyDE for the ant task

Hello,
   I'm using Eclipse Kepler with IvyDE. I have setup the Ivy settings path
in Eclipse (Window -> Preferences -> Ivy -> Settings) to my settings file (
http://vulcan/ivy-settings.xml). It works fine. But I also use some Ant
scripts inside Eclipse, and I need those scripts to access also the
repository. In order to do that I have needed to call the following task in
my Ant script

<ivy:settings url="http://vulcan/ivy-settings.xml"/>

Is there anyway I can remove that hardcoded url, and point the settings to
use the same URL used by IvyDE?

By the way, Apache Ivy is a wonderful tool. I'm really happy with it.

Thanks
JL

Re: Using same ivy-settings.xml in Eclipse with IvyDE for the ant task

Posted by Jose L Martinez-Avial <jl...@gmail.com>.
Hello Antoine,
   Well, I tried to use a environment variable for the file, but it seems ivyde does not understand that the variable is a url, and tries to recover the settings from c:\workspace\http\myserver\ivy-settings.xml. If I set the url directly in the ivy preferences, it works, but if I i try to use a variable it tries to look for the file in the filesystem, not in the web server. It seems to be a bug.

Thanks
JL 
Sent via BlackBerry from T-Mobile

-----Original Message-----
From: Antoine Levy Lambert <an...@gmx.de>
Date: Mon, 16 Dec 2013 00:09:37 
To: <iv...@ant.apache.org>
Reply-To: ivy-user@ant.apache.org
Subject: Re: Using same ivy-settings.xml in Eclipse with IvyDE for the ant task

Hello Jose,

I would create a property file outside of any particular Ant build file to store the location of the ivy settings file.
Then you can refer to this property file in the ant scripts and implement a solution to base your Eclipse ivyde configuration on this file.
I am not sure what would be the most clever solution for this particular problem but it should be doable.
Either by using some Eclipse specific provisioning tools or some Preference Import/Export functions or more simply by creating or changing automatically the preference file for ivyde which will be somewhere below <workspace>/.metadata

Alternatively, the ant scripts could find in the eclipse .metadata folder in your workspace the file containing the preferences for ivyde.
Then using an ant task to filter the XML of the preference file you can isolate the path to the ivy-settings.xml.
You could use the loadfile task and apply a filter chain isolate the path of the ivy settings file.
If you use the ant/eclipse integration it is possible to pass to ant the location of your workspace and work out from that the .metadata folder and the preference file for the ivyde plugin.
In the tab properties of the configuration of your ant run, you can add a property whose value would be taken from the workspace_loc Eclipse variable.

I would personally prefer the first solution because I consider the Eclipse metadata to be rather a byproduct than a "golden source".

Regards,

Antoine
On Dec 9, 2013, at 7:48 PM, JOSE L MARTINEZ-AVIAL wrote:

> Hello,
>   I'm using Eclipse Kepler with IvyDE. I have setup the Ivy settings path
> in Eclipse (Window -> Preferences -> Ivy -> Settings) to my settings file (
> http://vulcan/ivy-settings.xml). It works fine. But I also use some Ant
> scripts inside Eclipse, and I need those scripts to access also the
> repository. In order to do that I have needed to call the following task in
> my Ant script
> 
> <ivy:settings url="http://vulcan/ivy-settings.xml"/>
> 
> Is there anyway I can remove that hardcoded url, and point the settings to
> use the same URL used by IvyDE?
> 
> By the way, Apache Ivy is a wonderful tool. I'm really happy with it.
> 
> Thanks
> JL


Re: Using same ivy-settings.xml in Eclipse with IvyDE for the ant task

Posted by Antoine Levy Lambert <an...@gmx.de>.
Hello Jose,

I would create a property file outside of any particular Ant build file to store the location of the ivy settings file.
Then you can refer to this property file in the ant scripts and implement a solution to base your Eclipse ivyde configuration on this file.
I am not sure what would be the most clever solution for this particular problem but it should be doable.
Either by using some Eclipse specific provisioning tools or some Preference Import/Export functions or more simply by creating or changing automatically the preference file for ivyde which will be somewhere below <workspace>/.metadata

Alternatively, the ant scripts could find in the eclipse .metadata folder in your workspace the file containing the preferences for ivyde.
Then using an ant task to filter the XML of the preference file you can isolate the path to the ivy-settings.xml.
You could use the loadfile task and apply a filter chain isolate the path of the ivy settings file.
If you use the ant/eclipse integration it is possible to pass to ant the location of your workspace and work out from that the .metadata folder and the preference file for the ivyde plugin.
In the tab properties of the configuration of your ant run, you can add a property whose value would be taken from the workspace_loc Eclipse variable.

I would personally prefer the first solution because I consider the Eclipse metadata to be rather a byproduct than a "golden source".

Regards,

Antoine
On Dec 9, 2013, at 7:48 PM, JOSE L MARTINEZ-AVIAL wrote:

> Hello,
>   I'm using Eclipse Kepler with IvyDE. I have setup the Ivy settings path
> in Eclipse (Window -> Preferences -> Ivy -> Settings) to my settings file (
> http://vulcan/ivy-settings.xml). It works fine. But I also use some Ant
> scripts inside Eclipse, and I need those scripts to access also the
> repository. In order to do that I have needed to call the following task in
> my Ant script
> 
> <ivy:settings url="http://vulcan/ivy-settings.xml"/>
> 
> Is there anyway I can remove that hardcoded url, and point the settings to
> use the same URL used by IvyDE?
> 
> By the way, Apache Ivy is a wonderful tool. I'm really happy with it.
> 
> Thanks
> JL