Tuesday, November 1, 2011

Sonatype Nexus Configuration

We use Sonatype Nexus as a maven "mirror" server. It acts as a repository proxy, serving files that are not in the public repository or the versions we use are so old or unusual they can't be found in public maven repositories.
Important: The Nexus server runs upon port 8081.
Your local settings.xml file must have its url's point to http://xxx.xxx.xxx.xxx:8081 for the mirror repository. If you want to browse Nexus with your web browser use this URL: http://xxx.xxx.xxx.xxx:8081/nexus.

Starting Nexus Server

To start the Nexus server, follow the instructions below:
0) Open a Terminal
1) cd ~/dev/nexus-oss-webapp-1.9.2.2-bundle/nexus-oss-webapp-1.9.2.2
2) ./bin/jsw/macosx-universal-32/nexus start
3) tail -f ./logs/wrapper.log
4) Point browser to nexus server and you should see the nexus webapp: http://localhost:8081/nexus/index.html  

 

Stopping Nexus Server

To stop the Nexus Server, follow these instructions:
1) cd ~/dev/nexus-oss-webapp-1.9.2.2-bundle/nexus-oss-webapp-1.9.2.2
2) ./bin/jsw/macosx-universal-32/nexus stop

 

Re-installing Nexus Server

If you have to re-install nexus, download the latest open source version of Sonatype Nexus from their web site.
Copy the distribution to ~/dev
I was able to get it working by copying the directories from sonatype-work/nexus/storage from the old build system onto the same location of the newly installed system. I copied only the following directories: 'thirdparty', 'releases', and 'snapshots' 
From tomcat's archives, I got the file apache-tomcat-5.5.27.zip and copied it onto nexus' webapp at /Users/dev/nexus-oss-webapp-1.9.2.2-bundle/nexus-oss-webapp-1.9.2.2/runtime/apps/nexus/webapp so that the build could download it for Cargo.

 

Backup and recovery

The files which change for nexus are in the directory /dev/nexus-oss-webapp-1.9.2.2-bundle/sonatype-work/nexus/storage
To be safe this directory should be backed up periodically. Most important is the /thirdparty /snapshots and /releases directories under the above directory.


No comments:

Post a Comment