简体   繁体   English

如何获取artifactory来更新虚拟仓库的maven-metadata.xml?

[英]How to get artifactory to update the maven-metadata.xml for a virtual repo?

long time reader, first time asker... 长时间读者,第一次问问...

I have a standalone network (no internet access). 我有一个独立的网络(没有互联网接入)。 It has an artifactory server which has virtual libs-snapshot and libs-release repos. 它有一个神器服务器,它有虚拟的libs-snapshotlibs-release repos。 Under libs-snapshot , there are 4 local snapshot repos. libs-snapshot下 ,有4个本地快照存储库。 The reason for this is that we get a dump of all the artifactory repos from somewhere else (non-connected), and import it to this network. 这样做的原因是我们从其他地方(非连接)获取所有神器回购的转储,并将其导入该网络。 But we have to modify a subset of the snapshot artifacts there. 但我们必须修改那里的快照工件的子集。 So we created another local snapshot repo, call it mine-snapshot-local (maven 2 repo, set as unique, max artifacts=1?), and added it to the top of the libs-snapshot virtual. 所以我们创建了另一个本地快照仓库,称之为mine-snapshot-local (maven 2 repo,设置为唯一,max artifacts = 1?),并将其添加到libs-snapshot virtual的顶部。 In theory, this would allow us to modify the handful of artifacts we needed to, deploy to our own repo, and local developers would pick those up. 从理论上讲,这将允许我们修改我们需要的少量工件,部署到我们自己的仓库,本地开发人员会选择那些。 But we would still have access to the 99% of other artifacts from the periodic dump from the other non-connected system. 但是我们仍然可以从其他非连接系统的定期转储中访问99%的其他工件。 In addition, we can import the drops from the other network, which are concurrently being modified, on a wholesale basis without touching our standalone network repo ( mine-snapshot-local ). 此外,我们可以批量导入来自同时被修改的其他网络的丢弃,而无需触及我们的独立网络仓库( 我的快照本地 )。 I guess we're "branching" artifactory repos... 我想我们正在“分支”神器回购......

I realize we could probably just deploy straight into one of the imported repos, but the next time we get a dump from the other network, all those custom modified artifacts would go away... so I'd really like to get this method to work if possible. 我意识到我们可能只是直接部署到其中一个导入的repos中,但是下次我们从另一个网络获得转储时,所有这些自定义修改的工件都会消失...所以我真的很想让这个方法得到如果可能的话。

from my local eclipse, the maven plugin deploys artifacts explicitly, and without error, to the mine-snapshot-local repo. 从我的本地eclipse中,maven插件显式地将工件部署到mine-snapshot-local repo,并且没有错误。 The issue I'm seeing is that the maven-metadata.xml for the virtual libs-snapshot is not being updated. 我看到的问题是虚拟libs-snapshot的maven-metadata.xml没有被更新。 The timestamp of that file is updated, and if I browse with a web browser to libs-snapshot/whatever_package, I can see my newly deployed artifacts, with newer timestamps than the existing snapshots. 该文件的时间戳已更新,如果我使用Web浏览器浏览libs-snapshot / whatever_package,我可以看到新部署的工件,其时间戳比现有快照更新。 But the maven-metadata.xml file still contains pointers to the "older" snapshot. 但maven-metadata.xml文件仍包含指向“较旧”快照的指针。

maven-metadata.xml is successfully updated in the mine-snapshot-local repo, but it is as if artifactory is not merging all the metadata files together correctly for the virtual repo. maven-metadata.xml在mine-snapshot-local repo中成功更新,但就好像artifactory没有正确地将所有元数据文件合并到虚拟仓库中。 Or, more likely, I have misconfigured something to cause it to ignore our top-layer local repo somehow (but why would the snapshot jar/pom still show up there?). 或者,更有可能的是,我错误配置了某些东西导致它忽略了我们的顶层本地仓库(但为什么快照jar / pom仍会显示在那里?)。

We are using artifactory 2.6.1 (and do not have the option to upgrade). 我们正在使用artifactory 2.6.1(并且没有升级选项)。

I've tried a number of things: setting the snapshot repos to unique, nonunique, deployer, limiting the number of snapshots, etc. None of it seems to make much of a difference. 我尝试了很多方面:将快照存​​储库设置为唯一的,非唯一的部署程序,限制快照的数量等等。似乎没有任何区别。

The one thing I do see as possibly being an issue is the build number assigned to a snapshot. 我认为可能存在问题的一件事是分配给快照的内部版本号。 For example, in the imported repo, the artifact might have a timestamp that is a week old but a build number of 4355. In my new repo, when i deploy, i have a much newer timestamp, but the build number is 1 (or something much, much smaller than 4355). 例如,在导入的repo中,工件的时间戳可能是一周,但是内部版本号为4355.在我的新repo中,当我部署时,我有一个更新的时间戳,但内部版本号为1(或比4355小得多的东西。

Am I barking up the wrong tree by trying to have multiple local snapshot repos like this? 我试图拥有这样的多个本地快照存储库,从而咆哮错误的树吗? It seems like this should be ok, but maybe not. 看起来这应该没问题,但也许不行。

You are using a very (but very) old version of Artifactory and it could be that you are suffering from an issue that was long gone. 你正在使用一个非常(但非常)旧版本的Artifactory,它可能是你正在遭受一个早已消失的问题。 The normal behavior should be that if you have 4 maven repositories and you updated/deployed new artifacts into one of those repositories, the Virtual repository should aggregate the metadata from all of the listed repositories. 正常行为应该是,如果您有4个maven存储库并且您将新工件更新/部署到其中一个存储库中,则虚拟存储库应聚合来自所有列出的存储库的元数据。

Just to verify, you mentioned that you are deploying from Eclipse, are you referring to P2? 只是为了验证,你提到你是从Eclipse部署的,你指的是P2吗? If so just a side note, Artifactory will not calculate metadata for P2 artifacts. 如果只是旁注,Artifactory将不会计算P2工件的元数据。

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

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