Apache Ivy 简明教程

Apache IVY - Public Repository

公共存储库是可通过互联网访问的存储库,并具有第三方模块。默认情况下,ibiblio 处于 m2 兼容模式,即公共存储库。它也称为 maven 2 公共存储库。

Overriding ivysettings defaults

默认情况下,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-public.xml 的内容或在项目的设置文件夹中创建 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 内容。

Original - ivysetting-public.xml

<ivysettings>
   <resolvers>
      <ibiblio name="public" m2compatible="true"/>
   </resolvers>
</ivysettings>

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>