Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Apache Ivy: Difference between local Ivy cache and local repository

Tags:

java

apache

ant

ivy

By default Ivy installs a "local cache" under your <HOME>/.ivy2 directory. But if I decide to "host" a local repository on the same machine, say, at <HOME>/workbench/ivy/, then how are these two concepts different? Isn't a cache the same thing as an artifact repository?

like image 591
IAmYourFaja Avatar asked Feb 20 '12 18:02

IAmYourFaja


People also ask

What is Ivy cache?

In a nutshell, the ivy cache is designed to improve performance, it's not meant to be the definitive copy of the files a build depends on. One never publishes to the cache. This is what an ivy repository is used for.

What is an Ivy repository?

A local repository is a private repository of a user. It is very useful in case a user is using a library whose version has been changed on other places and have breaking changes. In case of local repository, ivy will use the library present in the local if found and will not look into public or shared repositories.

What is ivysettings?

The Ivy settings file: ivysettings. xml is used to configure resolution and deployment of artifacts using repositories in Artifactory. The Ivy modules file: ivy. xml is where the project's modules and dependencies are declared.

How does Apache Ivy work?

When the dependency module has been found, its ivy file is downloaded to the ivy cache. Then ivy checks if the dependency module has dependencies, in which case it recursilvely traverses the graph of dependencies. All over this traversal, conflict management is done to prevent access to a module as soon as possible.


1 Answers

The concepts page describes the function of the ivy cache and the kinds of file it contains:

http://ant.apache.org/ivy/history/latest-milestone/concept.html

In a nutshell, the ivy cache is designed to improve performance, it's not meant to be the definitive copy of the files a build depends on. One never publishes to the cache. This is what an ivy repository is used for.

Additonal notes:

  • There is an ivy cleancache task designed to purge ivy's cache (Something which is recommended, periodically, to cater for misbehaving repositories)
  • In Maven-land the "local" repository is also used as a cache..... ivy has a cleaner separation of purpose.
like image 62
Mark O'Connor Avatar answered Sep 27 '22 16:09

Mark O'Connor