Apache Ivy: Difference between local Ivy cache and local repository
Asked Answered
G

1

10

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?

Gonyea answered 20/2, 2012 at 18:17 Comment(0)
D
14

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.
Dagney answered 20/2, 2012 at 20:11 Comment(3)
Ahhh, you nailed it when you wrote "One never publishes to the cache", that was a tangential question I had as well. Thank you!Gonyea
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"?Wanettawanfried
@Wanettawanfried The "local" and "shared" directories are the default repository locations as documented here: ant.apache.org/ivy/history/latest-milestone/tutorial/….Garnet

© 2022 - 2024 — McMap. All rights reserved.