Maven private server warehouse configuration-Nexus detailed explanation!

WBOY
Release: 2024-03-02 10:52:37
forward
672 people have browsed it

Maven private server warehouse configuration-Nexus detailed explanation!

Maven private server warehouse is a tool specially used to store and share Java project dependencies. Nexus is a highly respected Maven private server warehouse management tool. The following will introduce in detail how to configure Nexus as a Maven private server warehouse:

  1. Download and install Nexus:

    • Visit Sonatype Nexus official website (

      ).

    • Download the OSS version of Nexus Repository Manager for your operating system.
    • Follow the instructions in the official documentation to install Nexus.
  2. Start Nexus:

    • Open a terminal or command prompt.
    • Enter the Nexus installation directory.
    • Execute the following command to start the Nexus service:

      ./bin/nexus start
      Copy after login
    • Wait for a while until Nexus starts. You can access it in your browser

      To verify whether Nexus starts successfully.

  3. Configure Maven settings:

    • Open Maven
      settings.xmlfile. This file is usually located at
      ~/.m2directory (Linux/macOS) or
      %USERPROFILE%/.m2directory (Windows).
    • Add the following configuration under the
      tag, replacing the URL, username and password with the address and credentials of your Nexus private server warehouse:

       nexus your-username your-password
      Copy after login
    • Save and close
      settings.xmlfile.
  4. Configure Nexus warehouse:

    • Open the browser and visit

      .

    • Log in to the Nexus console using the administrator credentials you set during installation.
    • Select
      Repositoriesin the left navigation bar, and then click the
      Create Repositorybutton.
    • Select the warehouse type (such as Hosted Repository, Proxy Repository or Group Repository) as needed and fill in the corresponding configuration information.
    • Click the
      Create Repositorybutton to create the repository.
  5. Configure the project to use the Nexus warehouse:

    • Open the project
      pom.xmlfile.
    • Add the following configuration under the
      tag and replace the URL with the address of your Nexus warehouse:

       nexus 
      Copy after login
      Copy after login
    • Add the following configuration under the
      tag and replace the URL with the address of your Nexus warehouse:

       nexus 
      Copy after login
      Copy after login
    • Save and close
      pom.xmlfile.

After completing the above steps, you have successfully configured Nexus as a Maven private server warehouse. You can use Nexus to manage and distribute your Java project's dependent libraries.

The above is the detailed content of Maven private server warehouse configuration-Nexus detailed explanation!. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:mryunwei.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!