Methods to Install a Nexus Repository Manager 3 License

This article applies to Nexus Repository Manager 3.1 and greater only.

 

Installing Using the User Interface ( recommended )

Installing your product license file using the user interface is the standard method to install your license.

Installing Using the Karaf Console

  1. Stop Nexus gracefully
  2. Enable the Apache Karaf console interface. Edit the file bin/nexus.vmoptions and change this line from "false" to "true":
    -Dkaraf.startLocalConsole=true
  3. Start Nexus in console mode using the run command:
    ./bin/nexus run
    ./bin/nexus /run    (on Windows)
  4. Press enter to drop to the Apache Karaf console prompt, then run the following command:
    nexus:license -m install -f /absolute/path/to/license/file/license.lic

Installing Using a System Property

Supported in Nexus 3.6.1 and newer.

This method is mainly intended to assist licensing a brand new setup of a high-availability master node repository manager instance that is unlicensed. If a license is already installed, installing a license using this method will not work.

  1. Locate your repository manager installation <data-directory>. By default this is ./sonatype-work/nexus3 relative to the <app-directory>.
  2. Create a new file, or edit the existing file at path <data-directory>/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 you were provided by Sonatype and readable by the user owning the repository manager process.

  4. Start Nexus. The nexus.log will contain messages indicating success or failure of reading the license file using this method. Examples:
    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
    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.

Copying an already installed license file into place

Linux and OSX Only. Windows not applicable.

Once installed. the Nexus Repository Manager license is stored in the Java user preferences store directory on Linux and Mac OSX.

By default. the product license can be found in the home directory of the user running Nexus at this location:

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

This means you can install the license using a supported method first for one process user, then just copy that file over to a new host or different user account and you'll have an installed license for that process user account as well.

Overriding the installed license file location

Linux and OSX Only. Windows not applicable.

You can override the default location of the Java user prefs using a system property, which can change the location where the license will be stored or read from.
  1. Find and edit the file <app_dir>/bin/nexus.vmoptions
  2. At the end of the file, add a new line like this:
    -Djava.util.prefs.userRoot=/absolute/path/to/already/created/directory
    

    The absolute path should point to an already created directory readable by the user account owning the repository manager process.

    Under this new directory, Nexus will expect to find the license file at a path com/sonatype/nexus/professional/prefs.xml

    This is also the directory where the product license will be written too when installed by a supported method.

Have more questions? Submit a request

0 Comments

Article is closed for comments.
Powered by Zendesk