Maven:存储库ID的含义

编程入门 行业动态 更新时间:2024-10-22 18:45:00
本文介绍了Maven:存储库ID的含义的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

在我的 POM 文件中,我指定了两个存储库:

In my POM file, I'm specifying two repositories:

<repositories> <repository> <id>myid</id> <url>url1</url> </repository> <repository> <id>myid</id> <url>url2</url> </repository> </repositories>

因此,从 Maven 文档中,我得到的印象是 id 元素应该与 settings.xml server 条目交叉引用, 指定认证信息.就我而言,url1 和 url2 都需要完全相同的身份验证数据;这就是为什么我对两者使用相同的 id.

So, from the Maven documentation, I got the impression that the id element should cross-reference with a settings.xml server entry, to specify authentication information. Both url1 and url2, in my case, require the very same authentication data; that is why I'm using the same id for both.

仍然,Maven 抱怨说 id 元素必须是唯一的.

Still, Maven complains, saying that the id element must be unique.

什么给?id 元素的目的究竟是什么?我知道(肯定)Maven 使用它来获取身份验证数据 - 这就是为什么当我只指定一个存储库时事情会起作用的原因.为什么我必须复制我的身份验证数据?我错过了什么?

What gives? What exactly is that purpose of the id element? I know (for sure) that Maven uses it to get authentication data - which is why things work when I only specify one repository. Why do I have to duplicate my authentication data? what am I missing?

推荐答案

ID 必须是唯一的.在 settings.xml 中使用 2 个登录配置.

ID has to be unique. Use 2 login configurations in your settings.xml.

更多推荐

Maven:存储库ID的含义

本文发布于:2023-11-28 16:31:18,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1643138.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:含义   Maven   ID

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!