EGHDK
EGHDK

Reputation: 18120

Artifactory is caching artifacts that I didn't intend

I'm not exactly sure how Artifactory works, but it seems to have cached 1 out of 15 different libraries I use in an Android project. More specifically, it seems like it's caching Guava. Later on, I'd like to set up caching so that all my machines can pull from my Artifactory server (instead of downloading the same lib/repo 5 times), but for now I'd like to disable this functionality completely. Is there any way to turn it off in a setting?

I just want Artifactory to serve my local artifacts, but it seems like it is trying to serve jcenter artifacts as well.

Upvotes: 0

Views: 675

Answers (1)

Dror Bereznitsky
Dror Bereznitsky

Reputation: 20376

Artifactory will cache artifacts that were requested from remote repositories. A remote repository in Artifactory serves as a caching proxy for remote artifacts (jcenter is an example of such repository).
When your build is resolving artifacts from Artifactory it is possibly resolving artifacts from remote repositories. This can be done if you are directly referencing remote repositories form your build or indirectly if you are referencing virtual repositories which aggregates remote repositories (for example the built-in remote-repos repository).
There are multiple options for achieving your requested behavior:

  1. Stop referencing remote repositories from your build script (directly on indirectly via virtuals)
  2. Configure the remote repository in Artifactory to be in offline mode - Artifactory does not try to fetch remote artifacts. Only locally-cached artifacts are retrieved. This can also be configured globally for all remote repositories.
  3. Configure the remote repository in Artifactory to not store artifacts locally - artifacts are note caches, direct repository-to-client streaming is used. This means that remote artifacts will still be resolved every time they are requested but not cached in Artifactory.

Upvotes: 3

Related Questions