Repository Management with Nexus
12.2. Manage Maven Settings Templates

12.2. Manage Maven Settings Templates

To manage Maven Settings templates, click on Maven Settings in the Enterprise section of the Nexus menu on the left side of the Nexus UI. Clicking on Maven Settings will load the panel shown in Figure 12.1, “The Maven Settings Panel”.

figs/web/settings_managing-templates.png

Figure 12.1. The Maven Settings Panel


The Maven Settings panel allows you to add, delete, and edit a Maven Settings template. The default template has an id of "default" and is read-only, it contains the recommended settings for a standard Nexus installation. To create a new Maven Settings template, click on the Add… button and select "Settings Template". Once the new template is created, assign a name to the template in the Template ID text input and click the Save button.

To edit a template, click on a template that has a User Managed value of true, and edit the template in the Settings Templated panel. Once you are finished editing the template, click Save to save the template. When editing the template, the following variables are available:

baseurl
This variable will be replaced with the base URL of the Nexus installation.
userId
This variable will be replaced with the user id of the user that is generating a Maven Settings file from this template.

To preview a Maven Settings template, click on the Template URL in the table of Maven Settings templates. Clicking on this URL will load a dialog window which contains the Maven Settings file generated from this template. This rendered view of the Maven Settings template will have all variable references replaced using the current context of the user: $baseurl will be replaced with the Base URL of the current Nexus installation, and $userId will be replaced with the user id of the current user.

Sonatype Promotion Subscribe via RSS