CICD Tutorial: Uploading Artifacts on Nexus Server using CLI
Hello! Welcome to this tutorial. Here, we will be talking about Nexus.
Download Nexus server with this LINK.
Now, Move to the location where Nexus is installed.
Find nexus.exe file which will be in bin folder.
Open command prompt in administrator mode in the same folder and run the following command : Nexus.exe /run
After this command is successful and Nexus Server is up, you have to open Nexus. Nexus will be accessible to localhost at port 8081 by default.
So, initially, for the first time, Nexus requests the password which is in the file that comes with the installation kit.
Find the default password at the sonatype-works/nexus3/ folder and the file name is admin.password.
After logging in, Nexus dashboard looks like below:
Now, After all this installation and configuration, here the experiment begins its main task.
Follow the steps below:
- Click on Create Repository to create a new repository. Select maven2 hosted repository.
2. Now, name the repository, set version policy to snapshot and allow redeploy.
3. Copy the URL of the repository.
4. Now, Add the following code in the settings.xml file located in the apache maven conf folder.
5. Now, all you have to do is create a new Maven Project and add the following code inside the “project” tag of pom.xml file.
6. To check the working of the maven project, open it in the command prompt and run “mvn clean”, “mvn install”, etc. command on it. So, it will show “Build Success”.
7. Run “mvn deploy” to deploy the built jar on the Nexus server.
You will see that your Maven repository is deployed at the specified nexus server URL. So this shows that the project is successful. Again to check the Repo, we can do it like this:
So, this is the double check. Now, we have completed this tutorial for Nexus Server. Thank You.