Visit my.sonatype.com for documentation on Nexus Repository version 2.
How to override the default Nexus Repository 2 Temporary Directory
For Nexus Repository 2.8.1+:
- Edit
${NEXUS_HOME}/bin/jsw/conf/wrapper.conf
, find the line containingwrapper.java.additional.2=-Djava.io.tmpdir=./tmp
. Change the./tmp
value to your preferred absolute directory path that already exists and is RW capable by the Nexus Repository process user. This should be a local disk location.
For Nexus Repository 2.8.0 and earlier:
- Edit
${NEXUS_HOME}/bin/jsw/conf/wrapper.conf
, add another propertywrapper.java.additional._n_=-Djava.io.tmpdir=/your/custom/tmp/dir
where _n_ is the next available number not already used. - Edit
${NEXUS_HOME}/conf/nexus.properties
, add a propertyjava.io.tmpdir=/absolute/path/to/your/custom/tmp/dir
.
History
In some Nexus Repository 2 releases, the java.io.tmpdir
is not set properly. The challenge is that unless the temporary directory that a Java application uses is explicitly set at time of java
program invocation, it may not take effect.
Due to this restriction, it was possible that the temporary directory used by Nexus Repository 2 was indeterminate for some operations. Nexus Repository 2 may have attempted to set the preferred default temporary directory via code to ${NEXUS_WORK}/tmp
. Nexus Repository 2 now defaults to the temporary directory used as ${NEXUS_HOME}/tmp.
Background
In Nexus Repository 1.9.x, the intended temporary directory used by the official Nexus bundle was set in ${NEXUS_HOME}/bin/jsw/conf/wrapper.conf
as ./runtime/tmp
.
In Nexus Repository 2.0, this was set in wrapper.conf as ./tmp
From Nexus Repository 2.1+ to 2.8.0, the temporary directory was no longer explicitly set in wrapper.conf, instead it was computed in code. This choice appears to have made the actual temporary directory used by the Nexus bundle somewhat unpredictable. NEXUS-6352
Nexus Repository 2.8.1 and greater has returned to set the temporary directory in ${NEXUS_HOME}/bin/jsw/conf/wrapper.conf
as wrapper.java.additional.2=-Djava.io.tmpdir=./tmp