Auxiliary Tools :: Nexus Repository Manager



I installed Nexus on pc-5-git-repo; IP=

  1. Update server:
    yum update
  2. Install wget:
    yum install wget
  3. Create directory zibi:
    mkdir /zibi
    cd /zibi
  4. Download the Nexus:
  5. Untar the downloaded file:
    tar -xvf nexus-3.0.2-02-unix.tar.gz
  6. Rename the untared file to nexus:
    mv nexus-3.0.2-02 nexus
  7. Create a new user named nexus:
    adduser nexus
  8. Change the ownership of nexus file to nexus user:
    chown -R nexus:nexus /zibi/nexus
  9. Open /zibi/nexus/bin/nexus.rc file, uncomment run_as_user parameter and set it as following:
  10. Running Nexus As Service:
    ln -s /zibi/nexus/bin/nexus /etc/init.d/nexus
    chkconfig –add nexus
    chkconfig nexus on
    service nexus start (it takes a while)


To log in, use the default username and password:
user: admin
password: admin123



Configuring Nexus as a Maven Repository

We will need:

  • a private (hosted) repository for our snapshots
  • a private (hosted) repository for our releases
  • a proxy repository pointing to Maven Central
  • a group repository to provide all of these repos under a single URL

Snapshots Repository

A repository for Maven artifacts with


in pom.xml.

Create a new maven (hosted) repository:
Releases Repository

A repository for Maven artifact that you deploy without -SNAPSHOT


in pom.xml.

Create a new maven (hosted) repository:
Proxy to Maven Central Repository

A repository that proxies everything you download from Maven Central.

Create a new maven (hosted) repository:
Group Repository

This will group all the above repos and provide you a single URL to configure your clients to download from/deploy to.

Create a new maven (hosted) repository:

Configuring Maven Projects to Use Nexus Repositories

Put this in your ~/.m2/settings.xml file. This will configure the credentials to publish to your hosted repos, and will tell your mvn to use your repo as a mirror of central:

And now configure your projects.
If you want only to download dependencies from Nexus, put this in the pom.xml:

And if you want also to publish your project, add:

Now if you run in your projects:

mvn install
mvn deploy

your mvn will point to your Nexus instance.


Leave a Reply