================
Sonatype Nexus
================
=> Nexus is an open source software (OSS) & It is free of cost.
=> It is used as Artifactory Repository Server.
=> It is used to store project build artifacts.
Ex: jar, war
=> Project artifacts will be stored in artifactory server for backup purpose.
=> Nexus software is developed by using java language.
=> The current version of nexus is 3.x version.
======================================================
Q) what is the difference between github and nexus ?
======================================================
=> Git Hub is used as source code repository server. It is used to store project source code.
=> Nexus is used as artifactory repository server. It is used to store project build artifacts (jar and war).
====================
Nexus Server Setup
====================
Git Repo URL : https://github.com/ashokitschool/DevOps-Documents/blob/main/07-Nexus-Setup-Docker.md
Note: Nexus server will run on port number 8081. Enable it in EC2 vm security group inbound rules.
=======================
Nexus Repository Types
=======================
=> In nexus we can create 2 types of repositories
1) Snapshot repository
2) Release repository
=> If project is under development then that project artifacts will be uploaded into snapshot repository.
=> If project is completed then that project artifacts will be uploaded into release repository.
Note: Based on tag value available in pom.xml file it will be decided that project is under development or project is getting released.
Ex-1 : 0.0.1-SNAPSHOT ===> Upload in SNAPSHOT REPO.
Ex-2 : RELEASE-1.0 ===> Upload in RELEASE REPO.
====================================
How to create repository in nexus
===================================
1) Login into nexus server
2) Go to settings
3) Go to repositories and click on 'Create Repository'
4) Select Maven 2(hosted) and create repository
Snapshot repo url : http://13.232.226.165:8081/repository/ashokit-snapshot-repo/
Release repo url : http://13.232.226.165:8081/repository/ashokit-release-repo/
===========================
Nexus Integration in CI CD
===========================
=> We can integrate "nexus repository artifact upload" process as part of Jenkins CI CD Pipeline.
Note: Once maven build process got completed then we can upload artifact into nexus repository.