Installing and Updating Licenses

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

Prerequisites

  • To use Nexus Repository Pro and its features, you will need a paid license. 
  • Managing licenses requires nx-admin or nx-license privileges.

Installing or Updating a License via the User Interface (Recommended)

The paid license is a .lic file that you upload to the Licensing feature view, which you can find under Administration → System → Licensing in the user interface. To install the license, complete the following steps:

  1. Upload the file from the Select license… button.
  2. Select the correct .lic file in the file selection dialog, and press Open.
  3. Click the Install license button.
  4. Enter your password when the re-authentication dialog appears.
  5. Click I agree to the terms stated in the End User License Agreement.
  6. Click Authenticate to complete the upload.
  7. If the instance was previously using a Nexus Repository OSS license, restart the repository manager for the new license to take effect.

After you have restarted Nexus Repository, the License type shown in the Licensing panel will display the features associated with your license.

Installing or Updating a License Using the REST API

You can also use the licensing API to install a binary license file as shown in the following example:

curl -v -u admin:admin123 -H "Accept: application/json" -H "Content-Type: application/octet-stream" --data-binary @/absolute/path/to/license.lic "http://localhost:8081/service/rest/v1/system/license"

For older versions, this endpoint may be a beta resource that would use "http://localhost:8081/service/rest/beta/system/license" instead of v1.

Installing or Updating a License Using a System Property

This method of installing a license will only work on new setups where a license is not yet installed.

To install a license using a system property, complete the following steps:

  1. Locate your repository manager installation data directory. By default, the data directory is found at ../sonatype-work/nexus3.
  2. Either create a new file or edit the existing file at path $data-dir/etc/nexus.properties.
  3. Add the following property in that file:

    nexus.licenseFile=/absolute/path/to/your/nexus/repository/manager/license.lic

    The referenced license.lic file should be the license file that Sonatype provided you and should be readable by the user owning the repository manager process.

  4. Start Nexus Repository.

The nexus.log will contain a log message indicating success or failure of reading the license file using this method.

Log message indicating the property is being used to load a license file:

2017-10-23 14:40:19,654-0500 INFO [jetty-main-1] *SYSTEM com.sonatype.nexus.licensing.ext.internal.NexusLicenseInstaller -
Installing license from property nexus.licenseFile=/absolute/path/to/your/nexus/repository/manager/license.lic

Log message indicating that a newer or the same license is already installed in the OS user Java preferences location, so the one referenced by the property is being ignored:

2017-10-23 14:40:19,654-0500 INFO [jetty-main-1] *SYSTEM com.sonatype.nexus.licensing.ext.internal.NexusLicenseInstaller -
Ignoring property nexus.licenseFile=/absolute/path/to/your/nexus/repository/manager/license.lic. A license is already installed.

Overriding the Installed License File Location

This section is only applicable to Linux and MacOS; it does not apply to Windows environments.

Use the following steps to override the default location of the Java user preferences using a system property that changes the location of where the license is stored or from which it is read:

  1. Find and edit the <app_dir>/bin/nexus.vmoptions file.
  2. At the end of the file, add a new line like the following:

    -Djava.util.prefs.userRoot=/absolute/path/to/already/created/directory
    The absolute path must point to an already created directory that is readable by the user account owning the repository manager process.

Under this new directory, Nexus Repository will expect to find the license file at com/sonatype/nexus/professional/prefs.xml
This is also the directory to which the product license will be written when installed through a supported method.

Copying an Installed License from Another Nexus Repository Instance

This section is only applicable to Linux and MacOS; it does not apply to Windows environments.

Once installed, the Nexus Repository license is stored in the Java user preferences store directory for the user that owns the Nexus Repository process. It is possible to move an already installed license from a licensed Nexus Repository instance to another unlicense instance since you can install licenses on multiple servers.

By default, you will find the product license in the home directory of the user running Nexus Repository at this location:

~/.java/.userPrefs/com/sonatype/nexus/professional/prefs.xml

You can install the license using a supported method for one process user and then copy the file to a new host or different user account. Then, you will have an installed license for both process users.

Monitoring Recent Connections for Product License Compliance

If you wish to approximate the number of unique users accessing Nexus Repository, we recommend using a log parser on the request.log files. By default, the IP address and autheticated user ID associated with each request will appear in columns 1 and 3 of each log line respectively.

You can also use LDAP queries against your LDAP server to help verify the number of unique users configured to access or are potentially accessing a Nexus Repository instance.

See our knowledge base article for more information.

What Happens if my Installed License Expires?

All functionality ceases except the ability to install a new license and generate a support zip.