Sky's blog

          我和我追逐的夢

          常用鏈接

          統(tǒng)計

          其他鏈接

          友情鏈接

          最新評論

          ivy中文參考文檔(16)-ant任務(wù)(4)-configure

          1) configure

              configure任務(wù)用于通過xml設(shè)置文件來配置ivy。

              查閱設(shè)置文件來獲取設(shè)置文件自身的細節(jié)。

              從2.0起 可以通過sttings聲明來配置ivy。和這個任務(wù)的不同之處在于當(dāng)使用settings聲明時,ivy的配置在settings第一次需要時(例如當(dāng)你做一次resolve)完成,而configure任務(wù)立即執(zhí)行一次配置,這樣如果有某些錯誤發(fā)生可以容易看到。


          2) 屬性

          屬性描述必要
          settingsId The 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 用于需要設(shè)置的ivy任務(wù)的 settingsRef屬性中。注意ivy任務(wù)會默認(rèn)搜索id為"ivy.instance"的設(shè)置,這個是默認(rèn)值
          No, 默認(rèn)為 "ivy.instance"
          file path to the settings file to use
          要使用的設(shè)置文件的路徑
          No. 如果提供文件,則URL被忽略。如果都沒有提供,則試圖查找${ivy.settings.file}文件,而如果這個文件也沒有,則使用default默認(rèn)設(shè)置文件
          url url of the settings file to use
          要使用的設(shè)置文件的URL
          override Specify what to do when another settings with the same id has already been loaded.
          指示當(dāng)已經(jīng)裝載一個同樣id的另一個設(shè)置時該怎么做
          • true
          • 當(dāng)前設(shè)置將優(yōu)先覆蓋任何之前定義的使用這個id的設(shè)置
          • false
          • 當(dāng)前設(shè)置將不覆蓋之前定義的使用這個id的設(shè)置
          • notallowed
          • 如果已經(jīng)有使用這個id的設(shè)置被定義,則報告錯誤
          No, 默認(rèn)為 "notallowed"
          host http authentication host No, 除非需要http認(rèn)證。
          realm http authentication realm
          username http authentication user name
          passwd http authentication password


          3) HTTP 認(rèn)證

              注意:HTTP認(rèn)證只有當(dāng)你的classpath下有commons-httpclient.jar時才能使用。如果任何你在ivy中使用的url(尤其在依賴解析時)需要http證,則你必須提供configure任務(wù)的host,realm,username和passwd屬性。這些設(shè)置將在后面調(diào)用ivy任務(wù)使用。

          4) 示例

              1. 最簡單的設(shè)置
          <ivy:configure />

          或者使用${ivy.settings.file}如果它存在,或者使用默認(rèn)設(shè)置文件。

              2. 使用文件來配置
          <ivy:configure file="myconffile.xml" />

              3. 使用url來配置
          <ivy:configure url="http://mysite.com/myconffile.xml" />

              4. 配置多個需要認(rèn)證的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>


          posted on 2009-08-04 21:29 sky ao 閱讀(1264) 評論(0)  編輯  收藏 所屬分類: project building

          主站蜘蛛池模板: 信阳市| 萍乡市| 二手房| 莱芜市| 云林县| 汉川市| 明光市| 甘孜县| 鄯善县| 阿巴嘎旗| 湖南省| 宁陕县| 和田县| 读书| 定西市| 元朗区| 秀山| 沙湾县| 类乌齐县| 万盛区| 铜陵市| 手机| 金秀| 万州区| 交口县| 敦煌市| 东阳市| 和龙市| 广南县| 射阳县| 百色市| 敖汉旗| 万载县| 瑞丽市| 杭锦旗| 建德市| 临邑县| 寿光市| 崇州市| 会同县| 田林县|