gpt4 book ai didi

maven Intranet 存储库故障转移重定向

转载 作者:行者123 更新时间:2023-12-04 04:49:13 27 4
gpt4 key购买 nike

我已将“Artifactory”设置为 Intranet maven 存储库。我有与故障转移相关的问题。

项目 POM

    <repositories>
<repository>
<id>central</id>
<url>http://mvn.mycompany.com:8081/artifactory/libs-release</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>snapshots</id>
<url>http://mvn.mycompany.com:8081/artifactory/libs-snapshot</url>
<releases>
<enabled>false</enabled>
</releases>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>central</id>
<url>http://mvn.mycompany.com:8081/artifactory/plugins-release</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
<pluginRepository>
<id>snapshots</id>
<url>http://mvn.mycompany.com:8081/artifactory/plugins-snapshot</url>
<releases>
<enabled>false</enabled>
</releases>
</pluginRepository>
</pluginRepositories>

问题:
是否可以使用故障转移存储库?意思..如果我的内网存储库关闭,那么 maven build 应该自动使用其他位置或直接从 maven 中心?

最佳答案

我不知道为什么你希望你的存储库关闭,但回到 maven central 是一个非常糟糕的主意。您失去了使用企业存储库的所有好处,甚至不知道它,因为无法确定您的构建从何处获取依赖项。

如果您担心存储库的可用性,则应建立具有多个服务器的 HA 环境,并逐个复制和备份。

如果您正在切换环境并且一旦您处于不同的环境中,则无法再访问来自其他 Intranet 的二进制存储库,您需要使用不同的配置文件切换使用新环境中可用的二进制存储库,其中将包含不同的配置文件服务器网址(或者可能只是访问原始服务器的代理)。

无论如何 - 用您的二进制存储库遮蔽 Maven 中心,不要将其用作备份。

关于maven Intranet 存储库故障转移重定向,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17688254/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com