无法使用 Apache Archiva 作为镜像
我认为这应该是一个简单的任务,但我一直无法完成。
我设置了一个档案存储库,如下所示:
- 2 个内部 Maven1 存储库(旧项目)
- 1 个内部 Maven2 存储库
- 7 个远程存储库(central、java.net、jboss.org 等)
对于每个内部存储库,我创建了一个代理连接与每个远程仓库。
我已将一个新镜像添加到我的 settings.xml 文件中,如 archiva 文档中所述:
<mirror>
<id>archiva.default</id>
<url>http://repo.mycompany.com:8080/archiva/repository/internal/</url>
<mirrorOf>*</mirrorOf>
</mirror>
当我尝试使用某些远程存储库的一个依赖项构建一个简单项目时,不会下载任何工件。为什么?!?
感谢您的任何帮助。
I think this was supposed to be a simple task, but I've been unable to accomplish it.
I've set an archiva repository as this:
- 2 Internal Maven1 repos (old projects)
- 1 Internal Maven2 repo
- 7 Remote repos (central, java.net, jboss.org, etc.)
For each internal repo I've created a proxy connection with each remote repo.
I've added a new mirror to my settings.xml file as explained in the archiva documentation:
<mirror>
<id>archiva.default</id>
<url>http://repo.mycompany.com:8080/archiva/repository/internal/</url>
<mirrorOf>*</mirrorOf>
</mirror>
When I try building a simple project with one dependency from some of the remote repositories, no artifacts are downloaded. Why?!?
Thanks for any help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Archiva 不会为存储库分配任何特殊角色。您从 Maven 向特定的托管存储库发出请求(因此从您的设置,
内部
),它将提供其中的内容,或者从已通过代理连接器连接的远程存储库代理它。默认情况下,这只是 Central - 添加新的远程存储库在通过代理连接器连接到托管存储库之前不会产生任何效果。您可能想要做的是将内部存储库上的代理连接器添加到相关的远程存储库。也可以考虑设置白名单,以便更有效。
您可能还想设置一个跨所有托管存储库(maven 1 和 maven 2)的存储库组,以便从单个 URL 进行使用。
Archiva doesn't assign repositories any special roles. You make requests to specific managed repository from Maven (so from your settings,
internal
), and it will serve what is in there, or proxy it from remote repositories that have been connected by a proxy connector. By default, that is just Central - adding a new remote repository has no effect until it is connected to a managed repository by a proxy connector.What you probably want to do is add a proxy connector on the internal repo to the remote repositories in question. Consider setting the whitelist too so that it is more effecient.
You may also want to set up a repository group that spans all the managed repositories (both maven 1 and maven 2) for use from a single URL.
我在 Archiva 2 中遇到了完全相同的问题,对我来说,解决方案是将“全局存储库观察者”角色授予来宾用户。
I had exactly the same problem with Archiva 2, for me the solution was to give the "Global Repository Observer" role to the Guest user.