Home > Computer Tutorials > Computer Knowledge > Maven private server warehouse configuration-Nexus detailed explanation!

Maven private server warehouse configuration-Nexus detailed explanation!

WBOY
Release: 2024-03-02 10:52:37
forward
808 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.xml file. This file is usually located at
      ~/.m2 directory (Linux/macOS) or
      %USERPROFILE%/.m2 directory (Windows).
    • Add the following configuration under the
      <servers> tag, replacing the URL, username and password with the address and credentials of your Nexus private server warehouse:

      <server>
        <id>nexus</id>
        <username>your-username</username>
        <password>your-password</password></server>
      Copy after login
    • Save and close
      settings.xml file.
  4. Configure Nexus warehouse:

    • Open the browser and visit

      .

    • Log in to the Nexus console using the administrator credentials you set during installation.
    • Select
      Repositories in the left navigation bar, and then click the
      Create Repository button.
    • 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 Repository button to create the repository.
  5. Configure the project to use the Nexus warehouse:

    • Open the project
      pom.xml file.
    • Add the following configuration under the
      <repositories> tag and replace the URL with the address of your Nexus warehouse:

      <repository>
        <id>nexus</id>
        <url>
      Copy after login
      Copy after login
    • Add the following configuration under the
      <distributionManagement> tag and replace the URL with the address of your Nexus warehouse:

      <repository>
        <id>nexus</id>
        <url>
      Copy after login
      Copy after login
    • Save and close
      pom.xml file.

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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template