We have multiple repositories in Nexus (i.e., releases, snapshot and site). All 3 repos are under public group and users uses the same credentials to access all these repositori
Not a solution but a workaround:
settings.xml will handle system properties and environment variables. So if you're not fussed about putting your server authentication details in a script or in your environment, you can stick with three server credentials but eliminate the need to update all three of them in favour of updating your script or environments (I've put examples for both options in this snippet):
releases
${env.NEXUS_USERNAME}
${nexus.password}
snapshots
${env.NEXUS_USERNAME}
${nexus.password}
site
${env.NEXUS_USERNAME}
${nexus.password}
Unfortunately there's no element supported in settings.xml!
Aside: maven already handles the snapshots and releases repositories within nexus, and that is the better way to do things. Your posted settings.xml even enables them already. Why do you need separate repository entries for snapshots and releases?