Nexus private server construction principle and tutorial analysis

Nexus private server construction principle and tutorial analysis

one. Why build a Nexus private server?

All development members of the company do not have external network. They connect to the nexus private server through the local area network, and the private server connects to the external network.

Publish the project to a private server. Other people can download it from the private server.

two. Architecture diagram after using private server

three. Building Nexus

3.1 Unzip nexus-2.10-1bundle.zip to any non-Chinese directory

3.2 Enter nexus-2.10-1\bin\jsw\indows-x86-4 (corresponding to your own system)

Take Windows 64 system as an example

  • instal-nexus.bat installation service
  • star-nexus.bat starts the service
  • stop-nexus.bat stops the service
  • unistal-nexus.bat uninstall service

3.3 Log in to the backend

Enter http://localhost:8081/nexus in your browser.

Default port 8081
Default username: admin
Default password: admin123

If you need to adjust, you can configure nexus-2.10-1\conf\exus.proerties

Four. Use Maven to connect to a private server

4.1 Modify Maven settings.xml

<?xml version="1.0" encoding="UTF-8"?>
<settings>
  <localRepository>G:\tool\m2\myrepository</localRepository>
  <mirrors>

    <mirror>
      <id>nexus-releases</id>
      <mirrorOf>*</mirrorOf>
      <url>http://localhost:8081/nexus/content/groups/public</url>
    </mirror>
    <mirror>
      <id>nexus-snapshots</id>
      <mirrorOf>*</mirrorOf>
      <url>http://localhost:8081/nexus/content/repositories/apache-snapshots/
      </url>
    </mirror>
  </mirrors>


  <profiles>
    <profile>
      <id>jdk-1.7</id>
      <activation>
        <activeByDefault>true</activeByDefault>
        <jdk>1.7</jdk>
      </activation>
      <properties>
        <maven.compiler.source>1.7</maven.compiler.source>
        <maven.compiler.target>1.7</maven.compiler.target>
        <maven.compiler.compilerVersion>1.7</maven.compiler.compilerVersion>
      </properties>
    </profile>



    <profile>
      <id>nexusTest</id>
      <repositories>
        <repository>
          <id>local-nexus</id>
          <url>http://127.0.0.1:8081/nexus/content/groups/public/</url>
          <releases>
            <enabled>true</enabled>
          </releases>
          <snapshots>
            <enabled>true</enabled>
          </snapshots>
        </repository>
      </repositories>
    </profile>


  </profiles>


  <activeProfiles> <!--Activate the profile with id nexusTest -->
    <activeProfile>nexusTest</activeProfile>
  </activeProfiles>
  <servers>
    <server>
      <id>releases</id>
      <username>admin</username>
      <password>admin123</password>
    </server>
    <server>
      <id>snapshots</id>
      <username>admin</username>
      <password>admin123</password>
    </server>
  </servers>
</settings>

G:\tool\m2\myrepository stores the local warehouse location

http://127.0.0.1:8081 Nexus server ip and port

admin/admin123 Nexus server login username and password

five. Steps to publish the project to a private server

5.1 Configure private server path in pom.xml

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.bjsxt</groupId>
  <artifactId>test</artifactId>
  <version>0.0.1-SNAPSHOT</version>

  <distributionManagement>
    <repository>
      <id>releases</id>
      <url>http://localhost:8081/nexus/content/repositories/releases</url>
    </repository>
    <snapshotRepository>
      <id>snapshots</id>
      <url>http://localhost:8081/nexus/content/repositories/snapshots</url>
    </snapshotRepository>
  </distributionManagement>

</project>

5.2 Configure the username and password for connecting to the private server warehouse in settings.xml

<servers>
    <server>
      <id>releases</id>
      <username>admin</username>
      <password>admin123</password>
    </server>
    <server>
      <id>snapshots</id>
      <username>admin</username>
      <password>admin123</password>
    </server>
  </servers>

5.3 Right click the project -> run as and enter deploy

After adding to the project, the corresponding package can be queried in the background

The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM.

You may also be interested in:
  • Analysis of the process of configuring Alibaba Cloud proxy warehouse based on Nexus
  • How to create a Docker repository using Nexus
  • How to build your own Nexus private server in Linux
  • How to upload the jar package to nexus via the web page
  • How to use nexus to build a Maven private server and idea in a local area network
  • Detailed steps for setting up a nexus server
  • CentOS7 Nexus installation steps detailed introduction
  • Maven nexus installation nexus private server problems and solutions

<<:  How much do you know about JavaScript inheritance?

>>:  Detailed explanation of the basic usage of MySQL triggers [create, view, delete, etc.]

Recommend

Multiple methods to modify MySQL root password (recommended)

Method 1: Use the SET PASSWORD command MySQL -u r...

Explain the difference between iframe and frame in HTML with examples

I don't know if you have used the frameset at...

Web front-end development CSS related team collaboration

The front-end development department is growing, ...

Notes on using $refs in Vue instances

During the development process, we often use the ...

Element Plus implements Affix

Table of contents 1. Component Introduction 2. So...

Linux Dig command usage

Dig Introduction: Dig is a tool that queries DNS ...

Detailed explanation of MySQL instance with SSD storage enabled

Detailed explanation of MySQL instance with SSD s...

How to install mysql5.6 in docker under ubuntu

1. Install mysql5.6 docker run mysql:5.6 Wait unt...

Learn javascript iterator

Table of contents Introduction What does an itera...

Detailed explanation of MySQL DEFINER usage

Table of contents Preface: 1.Brief introduction t...

How to implement https with nginx and openssl

If the server data is not encrypted and authentic...

Let’s talk in detail about how JavaScript affects DOM tree construction

Table of contents Document Object Model (DOM) DOM...