9

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?

IAmYourFaja
  • 55,468
  • 181
  • 466
  • 756

1 Answers1

13

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.
Mark O'Connor
  • 76,015
  • 10
  • 139
  • 185
  • 2
    Ahhh, you nailed it when you wrote "One never publishes to the cache", that was a tangential question I had as well. Thank you! – IAmYourFaja Feb 20 '12 at 20:33
  • There is a `local` subdirectory in my Ivy cache directory. I think this is related to the "Apache Ivy Local Repository". Is not this a kind of "publish to cache"? – clapas Jun 25 '15 at 09:42
  • @clapas The "local" and "shared" directories are the default repository locations as documented here: http://ant.apache.org/ivy/history/latest-milestone/tutorial/defaultconf.html. – Mark O'Connor Jun 25 '15 at 18:57