Installing/settin up Nexus repository

Thanks to Dvir Mizrahi for the help and knowledge that were needed to create this post.

First download the tar zip from http://www.sonatype.com/download-oss-sonatype
if you prefer version 2: https://support.sonatype.com/hc/en-us/articles/218238798-Nexus-Repository-Manager-OSS-Download-Archives

Upload the tar zip to your server.

  1. extract it to /usr/local/ (lets assume the file is called nexus-3.0.1-01-unix.tar.gz).
  2. create symbolic link to it in the /usr/local/bin this is because this folder is in the path and it will make it easier to upgrade (you will only need to change the symbolic link to the new version).
  3. Add the NEXUS_HOME and set to the installation folder. add script to do this in the start up and put the script in /etc/profile.d/
  4. add user nexus with a group nexus
  5. change the ownership of the directory to nexus:nexus
  6. change your use the nexus user and run the nexus

 

 

tar xvzf nexus-3.0.1-01-unix.tar.gz -C /usr/local
ln -s /usr/local/nexus-3.0.1-01/bin/nexus /usr/local/bin/nexus
echo -e '#!/bin/bash \nexport NEXUS_HOME=/usr/local/nexus-3.0.1-01\nexport NEXUS=$NEXUS_HOME/bin' > /etc/profile.d/nexus.sh
adduser --no-create-home --user-group nexus
chown -R nexus:nexus nexus-3.0.1-01
su nexuslocal
nexus start

 

Now you can access your nexus server from the browser.
http:/<server ip/name>:8081/nexus

You should see screen like this:
nexus
Now you should log in with: admin/admin123

After you configure you nexus, you should add the nexus server as the main repository to your pom.xml

<repository>
    <id>central</id>
    <releases>
        <enabled>true</enabled>
    </releases>
    <snapshots>
        <enabled>true</enabled>
    </snapshots>
    <url>http:/<server ip/name>:8081/nexus/content/groups/public/</url>
</repository>

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s