• Home
  • Docker
  • Kubernetes
  • LLMs
  • Java
  • Ubuntu
  • Maven
  • Big Data
  • Archived
Install | Nexus Repository Manager (a repository manager to store your artifacts)
  1. References
  2. Installation
  3. Server administration and configuration
  4. Maven configuration (".m2/settings.xml")
  5. Deploy a Maven artifact to Nexus
  6. Create a new repository

  1. References
    See this page for more details about Nexus: https://books.sonatype.com/nexus-book/reference3/

    Prerequisites:
    • Install Apache Maven
  2. Installation
    Download Nexus: https://www.sonatype.com/download-oss-sonatype

    Extract the file "nexus-3.18.0-01-unix.tar.gz" in the folder you want to install Nexus: /opt/nexus-3.18.0-01

    Change folders permissions:

    Create a symbolic link:
    Change the user who run Nexus:

    Setup the nexus home environemnt variable:

    Load ".profile" environment variables:
    Start Nexus:

    Access the default page of Nexus: http://localhost:8081

    Welcome - Nexus

    Other Nexus commands:

    Log directory:
  3. Server administration and configuration
    To access the "Server administration and configuration" page you must "Sign In".
    The default "admin" password can be found in this file: "/opt/sonatype-work/nexus3/admin.password"

    Sign in - Nexus

    The first time you sign-in, you will see a wizard that will help you complete required setup tasks:

    • Setup:
      Nexus wizard - setup

    • Please choose a password for the admin user:
      Nexus wizard - Please choose a password for the admin user

    • Configure Anonymous Access:
      Nexus wizard - Configure Anonymous Access

    • Complete:
      Nexus wizard - setup completed

    Server administration and configuration:

    Admin - Nexus
  4. Maven configuration (".m2/settings.xml")
    • Add a "mirror" element (inside element <mirrors>):

    • Add "server" elements for Snapshots/Releases (inside element <servers>) You can define only one if you want to use one configuration for both snapshots and releases. The default "admin" password can be found in this file: "/opt/sonatype-work/nexus3/admin.password"

    • Add a "profile" element for nexus repositories (inside element <profiles>):

    • Add an "activeProfile" element:
  5. Deploy a Maven artifact to Nexus
    Create a local directory that will hold the maven project:

    Run the following command "mvn archetype:generate" to create the maven project:

    Configure the "pom.xml" file of the project "mtitek-nexus-test-a".
    Add a "distributionManagement" element to configure the nexus repositories Snapshots and Releases:


    Run the follwoing maven command to deploy the maven artifact to nexus:


    Deployment - Nexus
  6. Create a new repository
    • Create folders for the "snapshots" and "releases" repositories:

    • Follow the following steps to setup a blob store:
      • Connect to Nexus Repository Manager (login with "admin").

      • Click the "Server administration and configuration" link.

      • Click the "Repository" link.

      • Click the "Blob Stores" link.

      • Click the "Create blob store" button.

      • Select the "Type" and enter a "Name" and a "Path" for the blob store.

      • Click the "Create blob store" button to save your configuration.

      Blob Store - Nexus

      Here are the fields to configure for both the snapshots and releases blob stores.


      Blob Store - Nexus

    • Follow the following steps to setup the repositories:
      • Click the "Server administration and configuration" link.

      • Click the "Repository" link.

      • Click the "Repositories" link.

      • Click the "Create repository" button.

      • Click the "maven2 (hosted)" link.

      • Enter a "Name" and Select the "Version policy" and a "Blob store" for the repository.

      • Click the "Create repository" button to save your configuration.

      Repository - Nexus

      Here are the fields to configure for both the snapshots and releases repositories.


      You can also define the following properties for your repository:
      • Strict Content Type Validation:
        Validate that all content uploaded to this repository is of a MIME type appropriate for the repository format: yes|no

      • Deployment policy:
        Controls if deployments of and updates to artifacts are allowed
        Deployment policy: Disable redeploy|Allow redeploy|Read-only

      Repository - Nexus

    • Configure the "pom.xml" file of your project.
      Add (or modify) the "distributionManagement" element to configure the nexus repositories (Snapshots and Releases):


    • Deploy your project:

      Deployment - Nexus
© 2025  mtitek