Every time Nexus is restarted, it asks for the license to be installed.

If Nexus is requesting for license to be installed every time it is restarted, then it is most probably due to the OS user that Nexus is started as, has no home directory defined.

The license details is stored in java preference store. In Linux this would be $USER_HOME/.java/.userPrefs/com/sonatype/nexus/professional/prefs.xml.

There are two options to resolve the issue:

Option 1) Create a home directory for the Nexus process user (ensure that Nexus process user can write to the home directory).

Option 2) Add a property java.util.prefs.userRoot to the file $NEXUS_HOME/bin/jsw/conf/wrapper.conf to define the location to store the java preference store (ensure that Nexus process user can write to this directory). Below are the steps to set to implement this.