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

NodeJS realizes image text segmentation

This article shares the specific code of NodeJS t...

How to enable the slow query log function in MySQL

The MySQL slow query log is very useful for track...

MySQL join buffer principle

Table of contents 1. MySQL join buffer 2. JoinBuf...

Docker case analysis: Building a Redis service

Table of contents 1 Create mount directories and ...

Detailed explanation of the pitfalls of mixing MySQL order by and limit

In MySQL, we often use order by for sorting and l...

CSS clear float clear:both example code

Today I will talk to you about clearing floats. B...

MySQL database must know sql statements (enhanced version)

This is an enhanced version. The questions and SQ...

MySQL 5.7.17 winx64 installation and configuration graphic tutorial

I summarized the previous notes on installing MyS...

Rounding operation of datetime field in MySQL

Table of contents Preface 1. Background 2. Simula...

js implements mouse in and out card switching content

This article shares the specific code of js to re...

The table merges cells and the img image to fill the entire td HTML

Source code (some classes deleted): Copy code The ...

Definition and usage of MySQL cursor

Creating a Cursor First, create a data table in M...

How to migrate sqlite to mysql script

Without further ado, I will post the code for you...