how to cache remote packages in Artifactory local repository?

10,889

Artifactory separates remote repositories from local repositories. After defining remote repositories (jcenter is preconfigured, so you can skip this step), accessing artifacts from the respective repositories (http://host:port/artifactory/simple/jcenter/ or any of the virtual repositories jcenter is a part of) will trigger remote download. You will be able to see the downloaded artifact in the jcenter-cache repository in the tree browser.

Please take a minute to read the repositories documentation to clearly understand the repository concept and the difference between local and remote repositories.

Share:
10,889
Pooya
Author by

Pooya

I enjoy computer-oriented stuffs specially programming. by the way, I never never give up :)

Updated on June 14, 2022

Comments

  • Pooya
    Pooya almost 2 years

    I've used Artifactory to setup a local repository on my server to let clients download java packages from it.
    I deployed a jar file to it and clients were able to get the jar file from the server.

    In case that a client requests for a package and it does not exist in the local repository, does the local repository download it from central repository and cache it for further requests? How can I ensure that? And where is it keeping these packages? I didn't found it in its default repositories.
    And BTW, is this feature enabled by default or we should configure Artificatory to enable this feature?



    UPDATE:
    I monitored requests log and in cases that a package exists in the repository, user can download it and the GET request status is 200 . But when a package does not exist in repository, the GET request will respond 404 and we expect that the package should be downloaded to local repository for further requests. But it is still responding 404 which means that it is not caching the package and user is downloading it from central repository directly without passing it through our local repository.