首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
您现在的位置: 程式碼之家 >> 編程語言 >  >> Java 程式設計 >> Java 相關知識

Ivy 參考文檔:設定檔完整指南

     編輯:Java 相關知識

設定檔概述

Ivy 有時需要設定才能如預期工作。實際上 Ivy 可在完全無特殊設定下運作(參閱預設設定文檔),但透過正確配置可在完全不同情境下工作。設定透過 XML 檔案指定,通常命名為 ivysettings.xml。在 Ant 中配置 Ivy,只需用設定檔路徑使用配置資料類型。

設定檔範例

<ivysettings>
  <properties file="${ivy.settings.dir}/ivysettings-file.properties" />
  <settings defaultCache="${cache.dir}" defaultResolver="ibiblio" checkUpToDate="false" />
  <resolvers>
    <ibiblio name="ibiblio" />
    <filesystem name="internal">
      <ivy pattern="${repository.dir}/[module]/ivy-[revision].xml" />
      <artifact pattern="${repository.dir}/[module]/[artifact]-[revision].[ext]" />
    </filesystem>
  </resolvers>
  <modules>
    <module organisation="jayasoft" name=".*" resolver="internal" />
  </modules>
</ivysettings>

大體上,設定檔配置 Ivy 使用的預設快取目錄和解析依賴的依賴解析器。

注意:此範例需要同目錄下的 ivysettings-file.properties 屬性檔提供所需 Ivy 變數。

實用變數

  • ivy.settings.dir:Ivy 設定檔所在目錄。若為檔案載入可用;若為 URL 則取最後 '/' 前部分;無 '/' 則不設定
  • ivy.settings.file:設定檔路徑,僅檔案載入時可用
  • ivy.settings.url:指向設定檔的 URL,檔案或 URL 載入時都會設定

1.4 版後,主要所有 Java 系統屬性皆可作為 Ivy 變數在設定檔中使用。

設定檔結構

ivysettings
  property
  properties
  settings
  include
  classpath
  typedef
  credentials
  lock-strategies
  caches
    cache
  latest-strategies
  version-matchers
  triggers
  parsers
  conflict-managers
  outputters
  namespaces
    namespace
      rule
        fromsystem
          src
          dest
        tosystem
          src
          dest
  macrodef
    attribute
  any resolver
  resolvers
    any resolver
  modules
    module
  statuses
    status

ivysettings 元素

每個設定檔的根標籤。

子元素

元素描述基數
property設定 Ivy 變數0..n
properties載入屬性檔作為 Ivy 變數0..n
settings用一些預設值配置 Ivy0..1
include包含其他設定檔0..n
classpath在 classpath 增加位置載入外掛0..n
typedef在 Ivy 中定義新類型0..n
lock-strategies定義鎖策略0..1
caches定義倉庫快取管理器0..1
latest-strategies定義最新策略0..1
parsers定義模組描述符解析器0..1
version-matchers定義新版本匹配器0..1
triggers註冊 Ivy 事件觸發器0..1
namespaces定義新命名空間0..1
macrodef定義新巨集解析器0..n
resolvers定義依賴解析器0..1
conflict-managers定義衝突管理器0..1
modules定義模組與解析器間規則0..1
outputters定義可用報告輸出器列表0..1
statuses定義可用狀態列表0..1
  1. 上一篇文章:
  2. 下一篇文章:
Copyright © 程式碼之家 All Rights Reserved