Devops Nexus Oss

Installation

we are going to install at our ubuntu box:

Create user:

ocm@grajuelinux:~$
sudo mkdir /opt/sonartype
ocm@grajuelinux:~$ sudo useradd -m -d /opt/sonartype/nexus nexus

Now you can download the latest tar.gz file:

https://sonatype-download.global.ssl.fastly.net/nexus/3/latest-unix.tar.gz

uncompress and link hiding the version:

nexus@grajuelinux:~$ su - nexus
nexus@grajuelinux:~$ cd 
nexus@grajuelinux:~$ tar xvf nexus-3.7.1-02-unix.tar.gz 

nexus@grajuelinux:~$ ln -sf nexus-3.7.1-02 nexus_oss

JAVA Settings: (vi .profile or .bashrc)
Add JAVA_HOME and append just before other paths so you are sure using the right JVM:

# set PATH so it includes user's private bin directories
JAVA_HOME="/opt/java"
PATH="$JAVA_HOME/bin:$HOME/bin:$HOME/.local/bin:$PATH"

Set the user who must run the processes:

nexus@grajuelinux:~/nexus_oss/bin$ vi nexus.rc 
run_as_user="nexus"

Ejecutar al inicio:

nexus@grajuelinux:~/nexus_oss/bin$ ln -sf /opt/sonartype/nexus/nexus_oss/bin/nexus /etc/init.d/nexus 

sudo systemctl enable nexus.service