Apache Ivy 简明教程
Apache IVY - Public Repository
公共存储库是可通过互联网访问的存储库,并具有第三方模块。默认情况下,ibiblio 处于 m2 兼容模式,即公共存储库。它也称为 maven 2 公共存储库。
A public repository is a repository accessible using internet and have third party modules. By default ibiblio in m2 compatible mode is the public repository. It is also referred as maven 2 public repository.
Overriding ivysettings defaults
默认情况下,ivy 在 ivy.jar 中存在的 ivysettings.xml 中具有自己的配置。
By default ivy has its configurations in ivysettings.xml present in 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-public.xml 的内容或在项目的设置文件夹中创建 ivysettings.xml。
To override public repository setting, update the contents of ivysettings-public.xml or create the ivysettings.xml in setting folder of your project.
ivysettings.xml
ivysettings.xml
<ivysettings>
<settings defaultResolver="default"/>
<include url="http://customserver/ivy/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>
更新默认的 ivysetting-public.xml 内容。
Update the default ivysetting-public.xml contents.
Original - ivysetting-public.xml
Original - ivysetting-public.xml
<ivysettings>
<resolvers>
<ibiblio name="public" m2compatible="true"/>
</resolvers>
</ivysettings>
Updated - ivysetting-public.xml
Updated - ivysetting-public.xml
<ivysettings>
<resolvers>
<filesystem name="public">
<ivy pattern="/path/to/my/public/rep/[organisation]/[module]/ivy-[revision].xml" />
<artifact pattern="/path/to/my/public/rep/[organisation]/[module]/[artifact]-[revision].[ext]" />
</filesystem>
</resolvers>
</ivysettings>