Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Multiple maven repository with the same credentials

Tags:

java

maven

I am using the Apache Maven 3.5.2 and I face the same problem. I try to pull dependencies from two nexus-releases-repository, using the same account(username + password)

My .m2/setting.xml contains:

<servers>
  <server>
    <id>nexus</id>
    <username>username</username>
    <password>password</password>
  </server>   
</servers>

My project's pom.xml contains:

 <repositories>
    <repository>
      <id>nexus</id>
      <url>https://DOMAIN/repository/repoA-maven-public/</url>
    </repository>

    <repository>
      <id>nexus</id>
      <url>https://DOMAIN/repository/repoB-maven-public/</url>
    </repository>
  </repositories>

I am using the same account to login into both of repository, but I get maven error repositories.repository.id must be unique. How that can be resolved

like image 995
Panagioths Parthenhs Avatar asked Oct 17 '22 06:10

Panagioths Parthenhs


1 Answers

From Repositories section of pom.xml documentation:

id, name: The id is used to uniquely identify this repository amongst many, and the name is a human readable form.

So, the id should be unique.

In our case, in settings.xml we have multiple servers definitions with the same credentials but different id values.

like image 64
Gonzalo Matheu Avatar answered Oct 20 '22 15:10

Gonzalo Matheu