Access the Oracle Maven Repository

The Oracle Maven Repository contains artifacts, such as ADF libraries, provided by Oracle. You may require these artifacts to compile, test, package, perform integration testing, or deploy your applications. For more information about the Oracle Maven repository, see https://maven.oracle.com/doc.html.

To build your applications and access the Oracle Maven Repository, you configure the job and provide your credentials to access the repository:

  1. Open https://www.oracle.com/webapps/maven/register/license.html in your web browser, sign in with your Oracle Account credentials, and accept the license agreement.

  2. Configure the POM file and add the Oracle Maven Repository details:

    1. Add a <repository> element that refers to https://maven.oracle.com:

      <repositories>
          <repository>
              <name>OracleMaven</name>
              <id>maven.oracle.com</id>
              <url>https://maven.oracle.com</url>
          </repository>
      </repositories>
      
    2. Depending on your application, you may also want to add the <pluginRepository> element and make it refer to https://maven.oracle.com:

      <pluginRepositories>
          <pluginRepository>
              <name>OracleMaven</name>
              <id>maven.oracle.com</id>
              <url>https://maven.oracle.com</url>
          </pluginRepository>
      </pluginRepositories>
    3. If you are going to use token-based authentication in your project, follow the steps in Set Up Token-Based Authentication to create a token with expiration and permission settings appropriate for your Maven project. (Don't forget to copy the token and paste it in a text file so you can access later.)

      Then add the <server> element and replace {token} with the token you created.

      <server>
          <id>internalRepo</id>
          <configuration>
              <httpConfiguration>
                  <all>
                      <headers>
                          <property>
                              <name>Authorization</name>
                              <value>Bearer {token}</value>
                          </property>
                      </headers>
                  </all> 
              </httpConfiguration>
          </configuration>	 
      </server>
  3. Commit the POM file to the project's Git repository.

  4. If you’re the project owner, set up Oracle Maven Repository connections for your project’s team members.

    See Create and Manage Oracle Maven Repository Connections.

  5. Create and configure a job to access Oracle Maven Repository.

    See Configure a Job to Connect to the Oracle Maven Repository.

Create and Manage Oracle Maven Repository Connections

If your project users access the Oracle Maven Repository frequently, you can create a pre-defined connection for them. Project users can then configure a job and use the connection to access the artifacts of the Oracle Maven Repository while running builds.

You must be a project owner to add and manage Oracle Maven Repository connections.

To create, edit, and delete a connection, you’ll need the Oracle Technology Network (OTN) Single Sign-On (SSO) credentials of a user who has accepted the Oracle Maven Repository license agreement:

Action How To

Add an Oracle Maven Repository connection

  1. In the left navigator, click Project Administration Project Administration.

  2. Select the Builds tile.

  3. Click the Maven Connection tab.

  4. Click + Create Maven Connection.

  5. In the Create Maven Connection dialog, in Connection Name, enter a unique name.

  6. In OTN Username and OTN Password, enter the credentials of a user who has accepted the Oracle Maven Repository license agreement.

  7. In Server Id, if necessary, enter the ID to use for the <server> element in the Maven settings.xml file or use the default maven.oracle.com ID.

  8. Click Create.

Edit a connection and change the connection’s user credentials or provide another server ID

  1. In the left navigator, click Project Administration Project Administration.

  2. Select the Builds tile.

  3. Click the Maven Connection tab.

  4. Click the connection name and then click the Edit icon.

  5. In the Edit Maven Connection dialog box, if necessary, enter the credentials of a user with valid SSO user name.

    In Server Id, if necessary, enter the ID to use for the <server> element in the Maven settings.xml file. If not provided, the ID defaults to maven.oracle.com.

  6. Click Update.

Delete the connection

  1. In the left navigator, click Project Administration Project Administration.

  2. Select the Builds tile.

  3. Click the Maven Connection tab.

  4. Click the connection name and then click Delete.

  5. In the Delete Maven Connection dialog, click Delete.

Configure a Job to Connect to the Oracle Maven Repository

Here's how you can set up a job using a predefined connection to connect to the Oracle Maven Repository:

  1. Open the job’s configuration page.
  2. Click the Before Build tab.
  3. Click Add Before Build Action and select Oracle Maven Repository Connection.
  4. From Use Existing Connection, select a pre-defined connection. Your project owner has created a connection so that you don't have to worry about setting it up.

    If there’s no pre-defined connection available or you want set up your own connection, click the toggle button. In OTN Username and OTN Password, enter the credentials of a user who has accepted the Oracle Maven Repository license agreement.

  5. In Server Id, if required, enter the ID to use for the <server> element of the Maven settings.xml file, or use the default maven.oracle.com ID.
  6. If you’re using a custom settings.xml file, in Custom settings.xml, enter the file’s path.
  7. Click Save.