Rajmahendra
Rajmahendra

Reputation: 3224

Changing the nexus repository directory

when i install Nexus war into my tomcat server Nexus creating its folder etc at Win home directory. I want to redirect this to my different directory.

Meaning.. I want nexus to store its repository in user defined folder

How to do this ?

Upvotes: 4

Views: 13003

Answers (4)

Fab Marchon
Fab Marchon

Reputation: 11

Since Nexus 2.8, you could set the nexus-work as an environment parameter for the tomcat JVM, like this :

JAVA_OPTS="-d64 -server -Xms128M -Xmx1024M -XX:MaxPermSize=512M -Dcom.sun.security.enableCRLDP=true -Djava.net.preferIPv4Stack=true -Djava.io.tmpdir=/tmp  -Dnexus-work=/var/lib/nexus/work "

It works for me as I have the Nexus OSS as a war file into a RHEL6 tomcat6 installation.

Upvotes: 1

Glenn Lawrence
Glenn Lawrence

Reputation: 3063

Setting the PLEXUS_NEXUS_WORK environment variable didn't work for me using Tomcat 7 and Nexus 2.8. Perhaps this no longer works with newer versions of Nexus.

What did work was to change the nexus-work setting in nexus.properties file, which is in the WEB-INF/classes folder of the Nexus web app

Here is what my setting now looks like:

nexus-work=D:/sonatype-work/nexus

Upvotes: 2

Brian Matthews
Brian Matthews

Reputation: 8596

You should set the environment variable PLEXUS_NEXUS_WORK to your user defined folder in your the /bin/setenv.cmd file and restart Tomcat before deploying the Nexus web application.

I don't have a Windows example handy but here is the /usr/share/tomcat7/bin/setenv.sh on my Linux deployment:

#! /bin/sh
export PLEXUS_NEXUS_WORK=/var/nexus

I assume that the Windows equivalent might be:

SET PLEXUS_NEXUS_WORK=C:\NEXUS

Upvotes: 2

Manfred Moser
Manfred Moser

Reputation: 29912

I would suggest to use the Nexus bundle installer with the embedded jetty server instead of running the Jetty war in Tomcat. While you can do that, you will not be able to upgrade to Nexus Professional easily since it is only supported with the embedded Jetty.

If you use the bundle installer the storage will be in a sibling folder to the nexus folder called sonatype-work/nexus.

Check out the free book Repository Management with Nexus for more info.

Upvotes: 1

Related Questions