================= SonaType Nexus ================= -> Nexus is an Open Source Software (OSS) & It is free. -> It is used as Artifactory Repository server. -> It is used to store project build artifacts. Ex: jar, war etc. Note: Project artifacts will be stored in artifactory repository server for backup purpose. -> Nexus software developed using java language. -> The current version of nexus is 3.x Note : The alternate for nexus is JFrog. ============================================================ Q) What is difference between Nexus repo and GitHub repo ? ============================================================ -> Github is a SCM software which is used to store source code of the project. -> Nexus is an Artifact Repository server which is used to store build artifacts (jar / war). ============= Nexus Setup ============= Git Repo : https://github.com/ashokitschool/DevOps-Documents/blob/main/07-Nexus-Setup-Docker.md ================================ Working with Nexus Repository ================================ => In nexus server, we can create 2 types of repositories to store project artifacts. 1) snapshot repository 2) release repository -> If project is under development then that project build artifacts will be stored into snapshot repository. -> If project development completed and released to production then that project build artifacts will be stored to release repository. Note: Based on name available in project pom.xml file it will decide artifacts should be stored into which repository. 0.0.1-SNAPSHOT => It will go to snapshot repository RELEASE-1.0 => It will go release repository -> Create Repositories by selecting "Maven 2 (Hosted)" - select policy -> After repositories created note down repo urls like below Snapshot repo url : http://3.108.191.58:8081/repository/ashokit-snapshot-repo/ Release repo url : http://3.108.191.58:8081/repository/ashokit-release-repo/ ================================================== Integrate Nexus Server Repos in our Maven Project ================================================== ## Step-1: Nexus Repos details we will configure in project pom.xml file like below nexus Ashok IT Releases Nexus Repo http://3.108.191.58:8081/repository/ashokit-release-repo/ nexus Ashok IT Snapshots Nexus Repo http://3.108.191.58:8081/repository/ashokit-snapshot-repo/ ## Step-2: We need to configure Nexus Server Credentials in Maven "settings.xml" file Maven settings.xml file Location : C:\apache-maven-3.8.5\conf -> In settings.xml file, under tag add below tag nexus admin admin@321 ## Step-3: Once these details are configured then we can run below maven goal to upload build artifacts to Nexus Server $ mvn clean deploy Note: When we execute maven deploy goal, internally it will execute 'compile + test + package + install + deploy' goals.