Skip to main content

Managing Maven Settings in Nexus Repository 2

Nexus Repository 2


Only available in Sonatype Nexus Repository Pro. Interested in a free trial? Start here.

When you move an organization to a repository manager such as Nexus Repository Manager, one of the constant challenges is keeping everyone’s Maven settings synchronized to ensure the repository manager server is used and any further configuration in the settings file is consistent. In addition, different users or use cases require different settings files. You can find out more about the Maven settings file in Maven and Other Build Tools. Nexus Repository Manager Pro allows you to define templates for Maven settings stored on the server and provide them to users via the user interface or automated download.

If an administrator makes a change that requires every developer to modify his or her ~/.m2/settings.xml file, this feature can be used to manage the distribution of Maven settings changes to the entire organization. Once you have defined a Maven settings template in Nexus Repository Manager Pro, developers can then use the Nexus M2Settings Maven Plugin to retrieve the new Maven settings file directly from Nexus Repository Manager Pro.

Overall the Maven Settings integration in Nexus Repository Pro allows you to maintain multiple settings template files on the central repository manager. You can configure settings files for different use cases, for example:

  • referencing a repository group containing only approved components in the mirror section for your release or QA builds

  • providing an open public group mirror reference to all of your developers for experimentation with other components.

By using the Nexus M2Settings Maven Plugin you can completely automate initial provisioning and updates of these settings files to your users.