【问题标题】:Using same ivy-settings.xml in Eclipse with IvyDE for the ant task在 Eclipse 中使用相同的 ivy-settings.xml 和 IvyDE 来执行 ant 任务
【发布时间】:2014-04-20 01:44:38
【问题描述】:

我将 Eclipse Kepler 与 IvyDE 一起使用。我已将 Eclipse 中的 Ivy 设置路径(Window -> Preferences -> Ivy -> Settings)设置为我的设置文件(http://myserver.com/ivy-settings.xml)。它工作正常。但是我也在 E​​clipse 中使用了一些 Ant 脚本,我需要这些脚本来访问存储库。为此,我需要在我的 Ant 脚本中调用以下任务

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

我是否可以删除该硬编码的 url,并将设置指向使用 IvyDE 使用的相同 URL?

谢谢

【问题讨论】:

  • 环境变量?
  • 我尝试创建一个值为 myserver.com/ivy-settings.xml 的字符串替换 ivy_settings_xml_url,并使用 ${ivy_settings_xml_url} 作为 ivy_settings 路径,但我收到一条错误消息“The Ivy settings file 'file:/C: /eclipse-kepler/http:/vulcan/ivy-settings.xml' 找不到”,所以它不起作用。

标签: eclipse ivy


【解决方案1】:

嗯,实际上有一个简单的方法可以做到这一点。您只需要定义字符串替换(转到 Window -> Preferences -> Ivy -> Settings -> Variables -> Edit Variables -> New;创建一个新变量 ivy_settings_xml_url 指向您的 ivy-settings.xml)并将 ${ivy_settings_xml_url} 作为 Ivy 设置路径)。然后,转到 Window -> Preferences -> Ant -> Runtime -> Properties 并添加一个值为 ${ivy_settings_xml_url} 的新属性 ivy_settings_xml_url。现在你可以在你的 ant 脚本中使用 ${ivy_settings_xml_url} 了:

<ivy:settings url="${ivy_settings_xml_url}"/>

【讨论】:

    猜你喜欢
    • 2012-02-04
    • 2012-04-16
    • 2012-06-02
    • 2013-08-15
    • 2018-03-25
    • 2014-02-14
    • 2011-02-07
    • 2012-09-30
    • 2015-03-11
    相关资源
    最近更新 更多