Skip to content
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
Cannot retrieve contributors at this time

Build Status

IMPORTANT: These are instructions for Nexus 3.x. See Nexus 2.x branch to deploy Nexus 2.x

WARNING: It is not possible to migrate Nexus 2.x to Nexus 3.x at this moment. If you deploy this branch to a current 2.x cartridge, Nexus 3.x will be deployed, but config and contents won't be migrated.

Nexus 3.x on OpenShift

This repository will deploy Sonatype Nexus to Openshift.

It is a variation of other solutions that use Tomcat (not recommended anymore as Nexus War is deprecated), archiving binaries at the repository itself, or starting/stopping services without control.

In this case the official jetty bundle distribution is used, no binaries are archived at the repository, and start/stop are controlled and report errors when needed.

No configuracion files are changed, as all configuration is made using environment variables. The only sensible difference is that Nexus is started calling directly to jetty to avoid using jsw, as jsw tries to bind to some TCP ports in a way not allowed by OpenShift.

I decided not to upgrade jsw (and setup wrapper.backend.type=PIPE) to use only the official Sonatype solution.

How to deploy

Create an OpenShift account

If you do not have an OpenShift account, you can create one at

Create a DIY application

Second step is creating a new DIY (Do It Yourself) application.

You can do it by using the CLI and running:

rhc app-create nexus diy-0.1 --from-code

Replace REF with master if you want latest 3.x version available, or use a Nexus 3.x tag

Or at the web interface:

And specifying at Source Code.

At Branch/Tag field specify master branch or a Nexus 3.x tag.

Wait until the app is deployed

After some time, your Nexus will be availabe at:


The default nexus user is admin/admin123. Remember to change it!

How to upgrade

First, make a backup of the ${HOME}/app-root/data/data/ directory, just in case, and read Nexus relase notes, available at their website.

Grab the GIT URL for your application, from the web console or using CLI, and clone the repository.

Switch to your local cloned repository, and add a new remote pointing to my repository:

git remote add upstream

Pull the changes, my changes will prevail over yours. Be sure you replace REF with master for latest 3.x version, or with a Nexus 3.x tag:

git pull -s recursive -X theirs upstream REF

And, finally, push to your instance:

git push

The upgrade will be ready in a few minutes.

When it is completed and you can verify everything is correct, you can remove the old nexus folder from the server, located at ${HOME}/app-root/data/