- 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>
广告