PREREQUISITES

Before you begin, you must have done the following:

${renderedContent}
${renderedContent}

These instuctions assume the following:

${renderedContent}

Overview

Configuring a Maven project to access a private repository requires setting up a name/password pair in the settings.xml file and associating the name/password with a specific repository which is defined in the project's pom.xml.

Items 1 and 2 below give the syntax of the entries for both the settings.xml and pom.xml files.  It is important to note the following:

${renderedContent}


The private repositories can be accessed by using either http or https.  Using https is highly recommended when using private repositories.

For instructions on how the configure Maven for https, refer to:

${renderedContent}


1. the settings.xml <server> element configuration

Add a <server> element to settings.xml file.

<servers>
    ...
    <server>
        <id>myPrivateRepo</id>
        <username>build#string</username>
        <password>myTeamListName</password>
    </server>
    ...
</servers>

where myTeamListName has the form dvtl<Team ID>.

Example: if your Team ID is uadev, then the <password> element would be <password>dvtluadev</password>.

2. the Maven pom.xml <repository> element configuration

A private repository can be accessed directly by using the <repository> element below:

<repositories>
    ...
    <repository>
        <id>myPrivateRepo</id>
        <name>This is my private repository</name>
        <url>https://maven.mit.edu/nexus/content/repositories/privateRepo</url>
    </repository>
    ...
</repositories>

note: In the above <url> tag, privateRepo must be replaced with the name of your private repository.

If there is a private repository group, then the private repository group can be accessed by using the <repository> element below:

<repositories>
    ...
    <repository>
        <id>myPrivateRepo</id>
        <name>This is my private repository group</name>
        <url>https://maven.mit.edu/nexus/content/groups/privateRepoGroup</url>
    </repository>
    ...
<repositories>

note: In the above <url> tag, privateRepoGroup must be replaced with the name of your private repository group.

  • No labels