[英]how to cache remote packages in Artifactory local repository?
I've used Artifactory to setup a local repository on my server to let clients download java packages from it. 我已经使用Artifactory在服务器上设置了本地存储库,以允许客户端从中下载Java包。
I deployed a jar file to it and clients were able to get the jar file from the server. 我向它部署了一个jar文件,客户端可以从服务器获取jar文件。
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? 顺便说一句,此功能是默认启用的还是我们应该配置Artificatory启用此功能?
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 . 我监视了请求日志,并且如果存储库中存在软件包,则用户可以下载它,并且GET请求状态为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.
但是,如果存储库中不存在某个软件包,则GET请求将响应404,我们希望该软件包应下载到本地存储库中以供进一步请求。 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.
但是它仍在404响应,这意味着它没有缓存包,并且用户直接从中央存储库下载了该软件包,而没有通过我们的本地存储库。
Artifactory separates remote repositories from local repositories . Artifactory将远程存储库与本地存储库分开。 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. 定义远程存储库(后jcenter是预先配置的,所以可以跳过此步骤),访问从各自的存储库工件(
http://host:port/artifactory/simple/jcenter/
或任何的虚拟库 jcenter
是的一部分)将触发远程下载。 You will be able to see the downloaded artifact in the jcenter-cache
repository in the tree browser . 您将能够在树浏览器的
jcenter-cache
存储库中看到下载的工件。
Please take a minute to read the repositories documentation to clearly understand the repository concept and the difference between local and remote repositories. 请花一点时间阅读存储库文档,以清楚地了解存储库的概念以及本地存储库和远程存储库之间的区别。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.