Sky's blog

          我和我追逐的夢

          常用鏈接

          統計

          其他鏈接

          友情鏈接

          最新評論

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

          1) configure

              configure任務用于通過xml設置文件來配置ivy。

              查閱設置文件來獲取設置文件自身的細節。

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


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


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

          主站蜘蛛池模板: 遵义县| 额尔古纳市| 铜川市| 怀安县| 鄂温| 苏州市| 察隅县| 阿鲁科尔沁旗| 金阳县| 广汉市| 前郭尔| 汉中市| 邢台市| 恭城| 阳泉市| 崇文区| 朔州市| 易门县| 新安县| 余干县| 崇礼县| 灵山县| 长宁区| 留坝县| 柘荣县| 榆林市| 乐清市| 白河县| 榆社县| 溆浦县| 延安市| 土默特右旗| 略阳县| 汉沽区| 海宁市| 扬中市| 万年县| 锦屏县| 临夏县| 建水县| 米脂县|