Apache IVY – Public Repository

Apache IVY - Public Repository

This topic is about Apache IVY – Public Repository.

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

By default ivy has its configurations in ivysettings.xml present in ivy.jar.

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>

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

Update the default ivysetting-public.xml contents.

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>

In this topic we learned about Apache IVY – Public Repository. To learn more, Click Here.

Leave a Reply