Domanda

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://myserver.com/ivy-settings.xml). It works fine. But I also use some Ant scripts inside Eclipse, and I need those scripts to access the repository. In order to do that I have needed to call the following task in my Ant script

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

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

Thanks

È stato utile?

Soluzione

Well, actually there is an easy way to do it. You just need to define the String substitution (go to Window -> Preferences -> Ivy -> Settings -> Variables -> Edit Variables -> New; create a new variable ivy_settings_xml_url pointing to your ivy-settings.xml) and put ${ivy_settings_xml_url} as the Ivy settings path). Then, go to Window -> Preferences -> Ant -> Runtime -> Properties and add a new property ivy_settings_xml_url with value ${ivy_settings_xml_url}. Now you can use ${ivy_settings_xml_url} in your ant script:

<ivy:settings url="${ivy_settings_xml_url}"/>
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top