问题
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>
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.
Still, Maven complains, saying that the id
element must be unique.
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?
回答1:
ID has to be unique. Use 2 login configurations in your settings.xml.
来源:https://stackoverflow.com/questions/15011250/maven-meaning-of-repository-id