Should the mirror id be unique in maven
What will happen if i have two mirrors with same id in the settings.xml file?
Which one will be taken into account?
It won't do anything more than 1 repo. You can even use it to have different mirrors with the same credentials.
But consider that you could did it by yourself ... This is a trivial question which take 1 minutes + build time to test by yourself.
<mirrors> <mirror> <id>mirror.repo.myorg.fr</id> <mirrorOf>!tiers-providers-public-snapshots,*</mirrorOf> <name>Repository Artifactory for snapshots.</name> <url>http://mirror.repo.myorg.fr/artifactory/repo-snapsthot</url> </mirror> <mirror> <id>mirror.repo.myorg.fr</id> <mirrorOf>!tiers-providers-public,*</mirrorOf> <name>Repository Artifactory for realeases</name> <url>http://mirror.repo.myorg.fr/artifactory/repo</url> </mirror> </mirrors>
This is the same machine, but two mirrors for differents purposes. I'm not sure this case would happen, but it is not so far of my own configuration.
I tried it, and it's obviously working.