简体   繁体   English

如何在Artifactory本地存储库中缓存远程软件包?

[英]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.

相关问题 如何引用 Maven 本地存储库中的包? - How to reference to packages from Maven local repository? 从Artifactory远程存储库下载大型工件 - Downloading Large Artifacts from Artifactory Remote Repository Egit:如何将Eclipse项目(本地存储库)与远程存储库同步 - Egit: how to synchronize eclipse project ( local repository) with the remote repository 如何从本地Artifactory存储库中导入已部署的jar“ SNAPSHOT”到另一个项目中? - How to import a deployed jar “SNAPSHOT” from local Artifactory repository into another project? 如何从远程存储库下载maven工件到本地文件夹? - How download maven artifact from remote repository to local folder? Maven-将远程存储库也用作本地存储库 - Maven - use a remote repository also as a local repository 我们的git远程存储库未与本地存储库同步 - Our git remote repository is not synchronized with local repository 将完整的maven远程存储库下载到本地存储库? - Downloading complete maven remote repository to Local repository? 将工件从本地Gradle工件存储库部署到JCenter / MavenCentral - Deploying artifacts from a local Gradle artifactory repository to JCenter/MavenCentral 将本地库发布到远程Maven存储库 - Publishing local libraries to remote maven repository
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM