- Apache IVY - Discussion
- Apache IVY - Useful Resources
- Apache IVY - Quick Guide
- Apache IVY - Public Repository
- Apache IVY - Shared Repository
- Apache IVY - Local Repository
- Apache IVY - Resolvers
- Apache IVY - info
- Apache IVY - publish
- Apache IVY - cachepath
- Apache IVY - retrieve
- Apache IVY - install
- Apache IVY - resolve
- Apache IVY - Eclipse Ivy Plugin
- Apache IVY - Settings File
- Apache IVY - Terminology
- Apache IVY - Environment Setup
- Apache IVY - Overview
- Apache IVY - Home
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
Apache IVY - Local Repository
A local repository is a private repository of a user. It is very useful in case a user is using a pbrary whose version has been changed on other places and have breaking changes. In case of local repository, ivy will use the pbrary present in the local if found and will not look into pubpc or shared repositories.
Default Location
By default, local repository is present in ${ivy.default.ivy.user.dir}/local folder. If you want to change it, the use the ivy.local.default.root variable in ant file.
build.xml
<target name="resolve"> <property name="ivy.local.default.root" value="/opt/ivy/repository/local"/> <ivy:resolve /> </target>
Other properties pke ivy pattern and artifact pattern can also be customized as follows −
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>
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-pubpc.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 local repository setting, update the contents of 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>Advertisements