Skip to content

Latest commit

 

History

History
139 lines (99 loc) · 3.23 KB

File metadata and controls

139 lines (99 loc) · 3.23 KB

Nexus

  • Login to your Linux server and update the yum packages. Also install required utilities.
sudo yum update -y
sudo yum install wget -y
  • Install OpenJDK 1.8
sudo yum install java-1.8.0-openjdk.x86_64 -y
  • Create a directory named app and cd into the directory.
sudo mkdir /app && cd /app
  • Download the latest nexus. You can get the latest download links fo for nexus
sudo wget -O nexus.tar.gz https://download.sonatype.com/nexus/3/latest-unix.tar.gz
  • Untar the downloaded file.
sudo tar -xvf nexus.tar.gz
  • Rename the untared file to nexus.
sudo mv nexus-3* nexus
  • create a new user named nexus to run the nexus service.
sudo adduser nexus
  • Change the ownership of nexus files and nexus data directory to nexus user.
sudo chown -R nexus:nexus /app/nexus
sudo chown -R nexus:nexus /app/sonatype-work
  • Open /app/nexus/bin/nexus.rc file
sudo vi  /app/nexus/bin/nexus.rc
run_as_user="nexus"
  • Create a svc for nexus
sudo vi /etc/systemd/system/nexus.service
[Unit]
Description=nexus service
After=network.target

[Service]
Type=forking
LimitNOFILE=65536
User=nexus
Group=nexus
ExecStart=/app/nexus/bin/nexus start
ExecStop=/app/nexus/bin/nexus stop
User=nexus
Restart=on-abort

[Install]
WantedBy=multi-user.target
  • Manage Nexus Service
sudo chkconfig nexus on

sudo systemctl start nexus

  • Access nexus using ip:8081
localhost:8081
  • Default username and password location will be given there
admin 

How to Create Nexus Repo

  • Login to Nexus using admin user and password

  • Click on Server Administrations and configuration

image

  • Click on Repositories

image

  • Click on create repository

image

  • Select maven 2 hosted

image

  • Give any name and click on select

image

  • You will see on newly created repo

image

Jenkins and Nexus

  • Login to Jenkins and install the plugin
nexus platform

image

  • Configure nexus Server

image

  • Click on system config image

  • Select Nexus server

image

  • Fill the information below image