简体   繁体   English

重用Artifactory的Maven回购

[英]Reusing Artifactory's maven repo

I'm trying to figure out if its possible to reuse Artifactory's maven repo on the local machine where the Artifactory server is running. 我试图找出是否有可能在运行Artifactory服务器的本地计算机上重用 Artifactory的Maven存储库。 The following details what I am trying to do. 以下详细说明了我要做什么。

I have a server where Artifactory runs and I'm planning on setting up Jenkins on the same server. 我有一台运行Artifactory的服务器,我正计划在同一台服务器上设置Jenkins。 If possible, I would like to have only one maven repository on the server. 如果可能,我希望服务器上只有一个Maven存储库。 Since Artifactory already runs there, I would expect it is maintaining some kind of a maven repository (I looked around for it but couldn't find it). 由于Artifactory已经在那儿运行了,所以我希望它正在维护某种Maven存储库(我四处寻找它,但找不到它)。

Currently, when Jenkins uses Maven to build a maven project, it downloads the dependent jars into a local maven repo (a .m2 folder) on the server. 当前,当詹金斯(Jenkins)使用Maven构建Maven项目时,它将依赖的jar下载到服务器上的本地Maven存储库(.m2文件夹)中。 Instead of this, would it be possible to point the settings.xml that maven is using to some local folder under Artifactory where artifactory stores all the jars? 取而代之的是,是否可以将maven使用的settings.xml指向Artifactory下人工存储所有jar的某个本地文件夹? Basically, I would like maven to think that all the jars are already available in a local repo (which artifactory is maintaining) and so it wouldnt have to download all the jars from artifactory. 基本上,我希望Maven认为所有jar都已在本地存储库中(由人工制品维护),因此不必从人工制品中下载所有jar。

If maven and artifactory can share the same repo folder, this would be possible. 如果Maven和人工制品可以共享相同的repo文件夹,则可以这样做。 But if Artifactory uses its own strucuture to maintain the maven repository (something other than the structure maven follows with its .m2 folder) this would not be possible. 但是,如果Artifactory使用自己的结构来维护Maven存储库(除了Maven后面带有.m2文件夹的结构,则这是不可能的)。

I should state that I have very minimal knowledge of Artifactory, other than the fact that it is a maven repository manager. 我应该说,我对Artifactory的了解非常少,除了它是Maven存储库管理器之外。

Answering my own question here, as more research suggests that this is not possible. 在这里回答我自己的问题,因为更多的研究表明这是不可能的。 I found another question here on SO that states: 我在SO上发现了另一个问题,指出:

Artifactory uses Java Content Repository (JCR) standard to store artifacts. Artifactory使用Java Content Repository(JCR)标准来存储工件。 It is an abstraction above various storage implementations, which include filesystem, relational databases, etc. In any case, JCR manages the store by checksums (to reduce size and bandwith), so the repository is not directly browesable in the filesystem. 它是各种存储实现(包括文件系统,关系数据库等)之上的抽象。在任何情况下,JCR都通过校验和来管理存储(以减小大小和带宽),因此无法在文件系统中直接浏览存储库。 The default implementation is storing the binaries on the filesystem (inside $ARTIFACTORY_HOME/data/filestore and the metadata in Derby DB. 默认实现是将二进制文件存储在文件系统中(在$ ARTIFACTORY_HOME / data / filestore和Derby DB中的元数据内部)。

How Artifactory manages repos Artifactory如何管理回购

A blog post by the Nexus guys also suggests that this is not possible. Nexus伙计们的博客文章也暗示这是不可能的。 Contrasting Nexus and Artifactory -> Contrast #2 对比Nexus和Artifactory->对比#2

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM