I've been added to another team at work. Both teams use their own Nexus servers, and have provided me their own settings files, so currently I have to do a lot of hoop-jumping to make sure I'm using the correct settings.xml file to get the projects to build. Is there a good way to merge these files? I've been going through the maven documentation but getting really confused. Settings files are below (identifying info removed)
Team 1 settings file
<settings>
<mirrors>
<mirror>
<id>Nexus</id>
<name>Company Nexus Public Mirror</name>
<url>http://build.company.com/nexus/content/groups/public/</url>
<mirrorOf>central</mirrorOf>
</mirror>
</mirrors>
<servers>
<server>
<id>snapshots</id>
<username>deployment</username>
<password>password1</password>
</server>
<server>
<id>releases</id>
<username>deployment</username>
<password>password2</password>
</server>
</servers>
<activeProfiles>
<activeProfile>jenkins</activeProfile>
</activeProfiles>
</settings>
Team 2 settings file
<settings>
<mirrors>
<mirror>
<!--This sends everything else to /public -->
<id>nexus</id>
<mirrorOf>*</mirrorOf>
<url>http://domain.company.com:8081/nexus/content/groups/public</url>
</mirror>
</mirrors>
<profiles>
<profile>
<id>nexus</id>
<!--Enable snapshots for the built in central repo to direct -->
<!--all requests to nexus via the mirror -->
<repositories>
<repository>
<id>central</id>
<url>http://central</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>central</id>
<url>http://central</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
<activeProfiles>
<!--make the profile active all the time -->
<activeProfile>nexus</activeProfile>
</activeProfiles>
<servers>
<server>
<id>snapshots</id>
<username>deployment</username>
<password>password3</password>
</server>
<server>
<id>releases</id>
<username>deployment</username>
<password>password4</password>
</server>
</servers>
</settings>
I tried just merging the <mirrors>
sections so both mirrors were listed, but only one team's code builds. I also don't understand how the server id's work. I'll have different username/password combinations for the different servers. I'd think the server id should match the id in the mirrors sections, but that clearly isn't the case. But if not that, how would maven know which snapshots or releases server to use?