java - Maven - Archiva - 为不同的地理位置设置 Archiva

标签 java maven-2 repository archiva

我们有在不同地理位置工作的开发人员,我们希望为每个地理位置设置 Archiva(只是为了确保获取工件的往返行程更少)。

是否有可能每当从位置 G1 的 Archiva 上传/删除工件时,相同的更改就会被推送到位置 G2 的 Archiva 管理的存储库, G3等等?

最佳答案

这不完全是您要求的,但对系统用户的最终效果是相同的,因此值得研究。

您可以使用 proxy connectors 将 Archiva 设置为代理远程存储库. 使用这种机制,您可以将 G2 配置为拥有 G1 的代理,这意味着当任何工件部署到 G1 时,它都可以通过代理机制在 G2 上使用。

来自文档:

A proxy connector is used to link a managed repository (stored on the Archiva machine) to a remote repository (accessed via a URL). This will mean that when a request is received by the managed repository, the connector is consulted to decide whether it should request the resource from the remote repository (and potentially cache the result locally for future requests).

Each managed repository can proxy multiple remote repositories to allow grouping of repositories through a single interface inside the Archiva instance. For instance, it is common to proxy all remote releases through a single repository for Archiva, as well as a single snapshot repository for all remote snapshot repositories.

A basic proxy connector configuration simply links the remote repository to the managed repository (with an optional network proxy for access through a firewall). However, the behaviour of different types of artifacts and paths can be specifically managed by the proxy connectors to make access to remote repositories more flexibly controlled.


如果代理连接器不适合您,您可以研究其他复制方法。我会重新考虑,因为任何自主开发的解决方案都可能在用户修改存储库内容时引入问题。

  • 只要您只允许部署到其中一个节点,您可以使用 rsync 或 robocopy 在节点之间复制存储位置。
  • 你可以写一个custom plugin监听获取和删除事件并向另一个节点触发相应的事件。

关于java - Maven - Archiva - 为不同的地理位置设置 Archiva,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1386061/

相关文章:

java - 将字段设置为 `volatile` 是否可以防止并发情况下的所有内存可见性问题?

java - startActivityForResult() 返回 RESULT_CANCELED

java - 无法理解 Maven 的全部内容,查看正式定义

android - Hudson 为 android maven2 项目配置了 PMD-Plugin

java - 绝对键盘输入位置(闪烁光标)

JAVA 从 linux 执行 powershell 脚本

eclipse - 如何重新安装 Eclipse 而不会丢失我的项目和插件?

git - 将导入的 repo 从 github 更新到 bitbucket

search - Github GraphQL 存储库查询,提交总数

architecture - 指向同一模型的单个或多个存储库