Nexus Repository 3 makes use of the Java preference store. This is located in $USER_HOME/.java/.userPrefs
on Linux systems, and the preference store requires that this location supports file locks.
To fix this problem, either enable file locking on the volume which contains the home directory of the user running Nexus Repository 3 or override the preference store location to point to a volume that has file locking. To do the latter, edit $NEXUS_HOME/bin/nexus.vmoptions file
Add a new line like below at the end of the file:
-Djava.util.prefs.userRoot=<path-to-directory-location-where-prefs-should-be-stored>
If Nexus Repository 3 is running from docker image, you can override the Java preference store location from the INSTALL4J_ADD_VM_PARAMS, that is passed to the Install4J startup script.
For example:
INSTALL4J_ADD_VM_PARAMS="-Xms2703m -Xmx2703m -XX:MaxDirectMemorySize=2703m -Djava.util.prefs.userRoot=${NEXUS_DATA}/javaprefs."
This can be adjusted at runtime:
$ docker run -d -p 8081:8081 --name nexus -e INSTALL4J_ADD_VM_PARAMS="-Xms2703m -Xmx2703m -XX:MaxDirectMemorySize=2703m -Djava.util.prefs.userRoot=/some-other-dir" sonatype/nexus3
Note that "-Djava.util.prefs.userRoot=/some-other-dir" should be set to a persistent path, which will maintain the installed Sonatype Nexus Repository License if the container is restarted.