ivy中文参考文档(16)-ant任务(4)-configure

1) configure

    configure任务用于通过xml设置文件来配置ivy。

    查阅设置文件来获取设置文件自身的细节。

    从2.0起 可以通过sttings声明来配置ivy。和这个任务的不同之处在于当使用settings声明时,ivy的配置在settings第一次需要时(例如当你做一次resolve)完成,而configure任务立即执行一次配置,这样如果有某些错误发生可以容易看到。


2) 属性

属性描述必要
settingsIdThe settings id useable in the settingsRef attributes of the ivy task that needs a setting. Note that the ivy tasks will search by default for the settings with the id "ivy.instance", which is the default value.
settings id 用于需要设置的ivy任务的 settingsRef属性中。注意ivy任务会默认搜索id为"ivy.instance"的设置,这个是默认值
No, 默认为 "ivy.instance"
filepath to the settings file to use
要使用的设置文件的路径
No. 如果提供文件,则URL被忽略。如果都没有提供,则试图查找${ivy.settings.file}文件,而如果这个文件也没有,则使用default默认设置文件
urlurl of the settings file to use
要使用的设置文件的URL
overrideSpecify what to do when another settings with the same id has already been loaded.
指示当已经装载一个同样id的另一个设置时该怎么做
  • true 当前设置将优先覆盖任何之前定义的使用这个id的设置
  • false 当前设置将不覆盖之前定义的使用这个id的设置
  • notallowed 如果已经有使用这个id的设置被定义,则报告错误
No, 默认为 "notallowed"
hosthttp authentication hostNo, 除非需要http认证。
realmhttp authentication realm
usernamehttp authentication user name
passwdhttp authentication password



3) HTTP 认证

    注意:HTTP认证只有当你的classpath下有commons-httpclient.jar时才能使用。如果任何你在ivy中使用的url(尤其在依赖解析时)需要http证,则你必须提供configure任务的host,realm,username和passwd属性。这些设置将在后面调用ivy任务使用。

4) 示例

    1. 最简单的设置

< ivy:configure  />


或者使用${ivy.settings.file}如果它存在,或者使用默认设置文件。

    2. 使用文件来配置

<!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> --> < ivy:configure  file ="myconffile.xml"   />


    3. 使用url来配置

< ivy:configure  url ="http://mysite.com/myconffile.xml"   />


    4. 配置多个需要认证的URL

< ivy:configure  file ="path/to/my/ivysettings.xml" >
  
< credentials  host ="myhost.com"  realm ="My Realm"  username ="myuser"  passwd ="mypasswd"   />
  
< credentials  host ="yourhost.com"  realm ="Your Realm"  username ="myuser"  passwd ="myotherpasswd"   />
</ ivy:configure >

 

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值