Maven:存储库ID的含义 [英] Maven: meaning of repository ID

查看:58
本文介绍了Maven:存储库ID的含义的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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

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

因此,从 Maven 文档中,我得到的印象是 id 元素应该与 settings.xml server 条目交叉引用, 指定认证信息.就我而言,http://url1http://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 http://url1 and http://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的含义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆