Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin

PREREQUISITES

Panel

Before you begin, you must have done the following:

indent
1
1
* Requested and received confirmation that a Developer Tools Team account has been created.  You can [request a Developer Tools Team account|https://src-prod.mit.edu/devtoolsSupport/dvTeamAccountRequest.jsp] at any time.\\
\\
When you receive confirmaiton that the private repository has been created, you will given the following information:\\
\\
indent
2
2
repository name\\
repository group name\\
Team ID\\
Team list name\\
\\
You will need the above information to configure your Maven project so that it can access the private repository.\\
Panel

These instuctions assume the following:

indent
1
1
* The name of the Nexus Repository server is maven.mit.edu.\\

Overview

Panel

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:

indent
1
1
* The <id> element that is used in both the settings.xml (found in the <server> element) and the pom.xml (found in the <repository> element) is what associates the name/password pair with the private repository.&nbsp;&nbsp;The <id> element in both places must be identical.&nbsp;&nbsp;It can be anything you want it to be, the only restriction is that they *must be identical*.\\
\\
* In the settings.xml, the <password> element *must* be the Team list name that was given to you when you received your repository confirmation.&nbsp;&nbsp;Refer to the {color:blue}*PREREQUISITES*{color} section above.\\
\\
* In the settings.xml, the <username> element *must* be *build#string*.\\


Panel

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:

indent
1
1
* [Maven, https and Java keystores with Mac OS X|Maven, https and Java keystores with Mac OS X],\\
\\
* [Maven, https and Java keystores with Windows|Maven, https and Java keystores with Windows], or\\
\\
* [Maven, https and Java keystores|Maven, https and Java keystores]\\


1. the settings.xml <server> element configuration

Panel

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

Code Block
<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

Panel

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

Code Block
<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:

Code Block
<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.