- Apache IVY 教程
- Apache IVY - 主頁
- Apache IVY - 概述
- Apache IVY - 環境設定
- Apache IVY - 術語
- Apache IVY - 設定檔案
- Apache IVY - Eclipse Ivy 外掛
- ANT Ivy 任務
- Apache IVY - resolve
- Apache IVY - install
- Apache IVY - retrieve
- Apache IVY - cachepath
- Apache IVY - publish
- Apache IVY - info
- 倉庫
- Apache IVY - 求解器
- Apache IVY - 本地倉庫
- Apache IVY - 共享倉庫
- Apache IVY - 公共倉庫
- Apache IVY 實用資源
- Apache IVY - 快速指南
- Apache IVY - 實用資源
- Apache IVY - 討論
Apache IVY - 本地倉庫
本地倉庫是使用者的私有倉庫。如果使用者正在使用其他地方的版本已更改且已進行重大更改的庫時,這非常有用。對於本地倉庫,ivy 將使用在本地中找到的庫,而不會查詢公共或共享倉庫。
預設位置
預設情況下,本地倉庫位於 ${ivy.default.ivy.user.dir}/local 資料夾中。如果您想更改它,請在 ant 檔案中使用 ivy.local.default.root 變數。
build.xml
<target name="resolve"> <property name="ivy.local.default.root" value="/opt/ivy/repository/local"/> <ivy:resolve /> </target>
還可以自定義其他屬性,如 ivy 模式和工件模式,如下所示 −
build.xml
<target name="resolve"> <property name="ivy.local.default.root" value="/opt/ivy/repository/local"/> <property name="ivy.local.default.ivy.pattern" value="[module]/[revision]/ivy.xml"/> <property name="ivy.local.default.artifact.pattern" value="[module]/[revision]/[artifact].[ext]"/> <ivy:resolve /> </target>
覆蓋 ivysettings 預設值
預設情況下,ivy 在 ivy.jar 中存在的 ivysettings.xml 中有其配置。
ivysettings.xml
<ivysettings>
<settings defaultResolver="default"/>
<include url="${ivy.default.settings.dir}/ivysettings-public.xml"/>
<include url="${ivy.default.settings.dir}/ivysettings-shared.xml"/>
<include url="${ivy.default.settings.dir}/ivysettings-local.xml"/>
<include url="${ivy.default.settings.dir}/ivysettings-main-chain.xml"/>
<include url="${ivy.default.settings.dir}/ivysettings-default-chain.xml"/>
</ivysettings>
要覆蓋本地倉庫設定,請更新 ivysettings-local.xml 的內容。
ivysettings-local.xml
<ivysettings>
<property name="ivy.local.default.root" value="${ivy.default.ivy.user.dir}/local" override="false"/>
<property name="ivy.local.default.ivy.pattern" value="[organisation]/[module]/[revision]/[type]s/[artifact].[ext]" override="false"/>
<property name="ivy.local.default.artifact.pattern" value="[organisation]/[module]/[revision]/[type]s/[artifact].[ext]" override="false"/>
<resolvers>
<filesystem name="local">
<ivy pattern="${ivy.local.default.root}/${ivy.local.default.ivy.pattern}" />
<artifact pattern="${ivy.local.default.root}/${ivy.local.default.artifact.pattern}" />
</filesystem>
</resolvers>
</ivysettings>
廣告