Can I make the nexus installation directory read only?

You can run a Nexus install in a read only location, but you'll need to make a few modifications first.

First, edit $NEXUS_HOME/bin/nexus and uncomment and set the PIDDIR line:

# Location of the pid file.

This specifies where the file that holds the currently running Nexus process ID will be created.  This file is used by the Nexus watchdog process to control the main Nexus executable.

Next, edit $NEXUS_HOME/bin/jsw/conf/wrapper.conf.  Look for this line:

Set this to the location of a directory where Nexus can create temporary files.

Finally, in the same file, look for this:


Set this to a full path where you want the log file for the Nexus watchdog process (the "wrapper") to be created.  
Note that the above applies only to the nexus installation directory (e.g. nexus-2.11.3, nexus-professional-2.11.3).  Nexus needs full read/write access to the work directory (sonatype-work/nexus).

Have more questions? Submit a request


Article is closed for comments.