Maven - 4, warehouse detailed explanation

1. Preface

Before maven appeared, when third-party jar packages were used in the project, we would copy these dependent jar packages to the lib directory of the project. If we developed multiple projects, these jar packages would have a copy in each project directory Copy, there are some problems with this:

  1. It is inconvenient to manage jar packages, such as upgrading and deleting jars

  2. Duplicate use of disk space

The main reason is that it is inconvenient to manage jar packages. Maven solves these problems very well. Let's take a look at the effect of maven management on dependent jar packages.

Let me ask a few questions, and look at the content of this article with questions

  1. How does maven introduce the dependent jar into the project?

  2. Where are the dependent jars in the maven project obtained from?

  3. How do we control how these jars are obtained?

  4. How does maven organize and manage components?

2. Environment

  1. maven3.6.1

  2. development tool idea

  3. jdk1.8

3. First look at the maven project case

Create a maven project, open the idea, click File->New->Project, select Maven, as follows:

Click Nextto enter the project coordinate information, as follows:

Click Nextand enter the Project name maven-chat03as follows:

Click Finishto create successfully, as follows:

Let's take a look at the disk size occupied by this project:

Occupies 29.9KB, below we introduce the fastjson dependency in pom.xml:

<dependencies>
    <dependency>
        <groupId>com.alibaba</groupId>
        <artifactId>fastjson</artifactId>
        <version>1.2.62</version>
    </dependency>
</dependencies>

 Create a Demo.java, as follows

package com.javacode2018;

import com.alibaba.fastjson.JSON;

public class Demo1 {
    public static void main(String[] args) {
        System.out.println(JSON.class);
    }
}

Run Demo1, output:

class com.alibaba.fastjson.JSON

It shows that fastjson works in the project, let's take a look at the size of the project

The previous time was 39kb, this time it was 49kb, and the size increased by 10KB. Let's take a look at the size of fastjson.jar

This jar package is 643kb, but the project is only 49kb, what does this mean?

It shows that the jar package is not included in the project directory, but only a reference to the jar package is made.

If there are many projects in the system that use the same maven to refer to the dependent jar packages, then only one copy of these jars will be stored on the disk, and these jars can be shared by all other maven projects. The projects only need to be in pom.xml These jars are referenced by maven coordinates instead of being copied to the project. If you delete the jar package or upgrade the version, you can directly modify the pom.xml, which is very convenient.

Conclusion: Maven introduces the dependent jars by reference, and does not copy the real jars, but when packaging, the jars needed for running will be copied into the installation package.

4. Maven looks for dependent jars

We can see that when we need to use certain jars in our project, we only need to add the maven coordinates of these jars to pom.xml. How does maven find these jars behind this?

Maven officially provides us with a site that stores many third-party commonly used builds (jar, war, zip, pom, etc.). When we need to use these components, we only need to add their coordinates to pom.xml In this case, maven will automatically download these builds to a local directory, and then automatically reference them.

The maven site mentioned above is called the maven central warehouse, and the local directory is called the local warehouse.

By default, when a dependent jar package is introduced into a project, maven first retrieves the jar in the local warehouse. If the local warehouse does not have it, maven searches for it from the central warehouse, and then downloads the dependent components from the central warehouse to the local warehouse, and then It can be used, if there are no two places, maven will report an error.

Let's take a look at what is a warehouse?

5. Maven repository

In Maven, any dependency, plug-in or project build output can be called a component.

In Maven, a warehouse is a location, which is used to store various third-party components, and all maven projects can share the components in this warehouse.

The Maven repository can help us manage components (mainly jar packages), it is where all jar files (jar, war, zip, pom, etc.) are placed.

5.1. Classification of warehouses

Mainly divided into 2 categories:

  1. local warehouse

  2. remote warehouse

The remote warehouse is divided into: central warehouse, private server, and other public remote warehouses

When maven searches for components according to the coordinates, it will first check the local warehouse. If the local warehouse exists, it will be used directly; if the local warehouse does not exist, maven will search in the remote warehouse. If it is found, it will be downloaded to the local warehouse. If the component is not found in the local and remote warehouses, maven will report an error, and the component can only be used by the maven project if it exists in the local warehouse.

5.1.1, local warehouse

By default, the default address of the maven local warehouse is ~/.m2/respositorya directory, which we can also ~/.m2/settings.xmlmodify in the file by default:

<localRepository>本地仓库地址</localRepository>

When we use maven, the dependent components will be downloaded from the remote warehouse to the local warehouse directory.

Maven's local warehouse will not be created after Maven is installed. When we execute the first maven command, the local warehouse will be created. At this time, the build will be downloaded from the remote warehouse to the local warehouse for the maven project to use.

We need to pay attention, by default, ~/.m2/settings.xmlthis file does not exist ( ~referring to the user directory, which was introduced in the previous article, and will not be explained here), we need to copy conf/settings.xmlthe file from the Maven installation directory, and M2_HOME/conf/settings.xmlcopy it to ~/.m2the directory , and then ~/.m2/settings.xmledit it, M2_HOME/config/settings.xmlthis file can actually be used, but we do not recommend using it directly, this modification may affect all other users, and modifying this file is not conducive to future maven upgrades, if we use ~/.m2/settings.xml, but the configuration in the maven installation directory does not change. When upgrading, you only need to replace the installation package, so we recommend copying the maven installation directory to edit. This is user-level and will only affect the settings.xmlcurrent ~/.m2user .

5.1.2, remote warehouse

When we first used maven, the components in the local warehouse were empty. At this time, maven must provide a function to be able to obtain these components from the outside. This external is the so-called remote warehouse. There can be multiple remote warehouses. When the component cannot be found in the local warehouse, you can go to the remote warehouse to find it, and then put it in the local warehouse for use.

5.1.3. Central Warehouse

Since the local warehouse is empty when maven is just installed, we have not configured anything at this time. When we execute the maven command, we will see that maven has performed some download operations by default. This download address is the address of the central warehouse. This address is provided by the maven community for us. It is a default remote warehouse address built into maven and does not require users to configure it.

Where is this address in the maven installation package?

We are using 3.6.1, in the following location

apache-maven-3.6.1\lib\maven-model-builder-3.6.1.jar\org\apache\maven\model\pom-4.0.0.xml

In pom-4.0.0.xml, as follows:

<repositories>
    <repository>
      <id>central</id>
      <name>Central Repository</name>
      <url>https://repo.maven.apache.org/maven2</url>
      <layout>default</layout>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
    </repository>
  </repositories>

that is:

https://repo.maven.apache.org/maven2

You can visit it as follows:

The above site contains many commonly used builds.

The central warehouse has several characteristics:

  1. The central warehouse is provided by the maven official community for everyone to use

  2. We don't need to configure it manually, maven is integrated internally

  3. When using the central warehouse, the machine must be connected to the Internet, and the address of the central warehouse must be accessible

The central repository also provides us with a site for retrieving artifacts:

It is very convenient for us to find the components we need to rely on, and you can experience it.

The central warehouse contains most of the world's popular open source java components, basically all java developers will use this warehouse, and generally the third-party components we need can be found here.

5.1.4, private server

Private server is also a kind of remote warehouse, why do we need private server?

If there are hundreds of people in our team who are developing some projects, and we use maven to organize the projects, then each of us needs to download the components that we need to depend on from the remote warehouse to the local warehouse. It is also relatively high. In order to save this broadband and speed up the download speed, we can set up a server in the company's internal LAN. This server acts as a proxy. When all developers in the company visit this server, this server will The required build is returned to us. If there is no build we need in this server, then the proxy server will go to the remote warehouse to find it, and then download it to the proxy server first, and then return it to the developer's local warehouse.

There are also many projects in the company that depend on each other. You may be in the architecture group. You need to develop some jar packages for other groups to use. At this time, we can publish our own jars to private servers for other colleagues to use. If not For private servers, we may need to manually send it to others or upload it to a shared machine, but it is not very convenient to manage.

Generally speaking, private servers have the following advantages:

  1. Accelerate the download speed of maven artifacts

  2. save bandwidth

  3. Easily deploy your own components for others to use

  4. To improve the stability of maven, the central warehouse needs the local machine to be able to access the external network, and if the private server is used, only the local machine can access the private server of the internal network.

Regarding private servers, there will be a dedicated article later that will introduce them in detail.

5.1.5. Other remote warehouses

The central warehouse is located abroad, and the access speed is not particularly fast, so many relatively large companies have done some good things, built some maven warehouse servers by themselves, and made them public for other developers to use, such as Ali, Netease, etc., they Some maven warehouses are provided for global developers to use, and the access speed in China is much faster than that of the maven central warehouse.

There are also some companies that are more powerful and only publish components in their own public warehouses. In this case, if you want to use their components, you need to visit the remote warehouse address they provide.

5.1.6. Layout of build files

Let's take a look at how components are composed in the file structure of the warehouse?

We will use the local warehouse to explain this part. The way to organize components in the remote warehouse is the same as that in the local warehouse. Take the information of fastjson in the local warehouse as an example to illustrate, as follows:

<dependency>
    <groupId>com.alibaba</groupId>
    <artifactId>fastjson</artifactId>
    <version>1.2.62</version>
</dependency>

The above is the jar of fastjson 1.2.62, let's take a look at the location of this jar in the local warehouse, as shown below

The address of the jar of fastjson is:

~\.m2\repository\com\alibaba\fastjson\1.2.62\fastjson-1.2.62.jar

~\.m2\repository\It is the directory of the warehouse, and all local components are located in this directory. Let's mainly look at how the latter part is composed.

The structure of the component directory is as follows:

groupId+"."+artifactId+"."+版本号

Obtain a string through the above, the string is connected groupId、artifactId、版本号by between ., and then replace the string in this string .with the file directory separator and create a multi-level directory.

The composition of the component file name is as follows:

[artifactId][-verion][-classifier].[type]

The above fastjson-1.2.62.jar information is as follows:

artifactId为fastjson
version为1.2.62
classifier为空
type没有指定,默认为jar

So the component file name is fastjson-1.2.62.jar.

6. About the component version

Usually when we develop a project, we package and test it, or when we provide the build we developed for others to use, we repeatedly package and test it in the middle, and provide users with many unstable versions. Finally, after repeated verification and modification by colleagues and tests , we will release a stable version.

Before the stable version is released, there will be many unstable test versions. Our version is called the snapshot version, which is represented by SNAPSHOT. Go back and look at the pom.xml file built at the beginning of this article. The default is the snapshot version, as follows maven-cha03:

<version>1.0-SNAPSHOT</version>

Version -SNAPSHOTends with , indicating that this is an unstable version. We should only use this version for internal testing in the company. When it is finally released, we need to remove it and -SNAPSHOTrelease a stable version, indicating that this version is stable. Yes, it can be used directly. We call this stable version releaseversion.

What should we do when we want to control the remote address obtained by the component? At this time, you need to use the configuration function of the remote warehouse.

7. Configuration of remote warehouse in Maven

Here we explain 2 ways.

7.1. Method 1

Configure the remote warehouse in pom.xml, the syntax is as follows:

<project>
    <repositories>
        <repository>
            <id>aliyun-releases</id>
            <url>https://maven.aliyun.com/repository/public</url>
            <releases>
                <enabled>true</enabled>
            </releases>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </repository>
    </repositories>
</project>

Under the repositories element, one or more remote repositories can be declared using the repository sub-element.

Repository element description:

  • id: An identification of the remote warehouse, the id of the central warehouse is central, so when adding a remote warehouse, the id should not be repeated with the id of the central warehouse, and the central warehouse will be overwritten

  • url: remote warehouse address

  • releases: mainly used to configure whether to download stable version builds from this remote warehouse

  • snapshots: mainly used to configure whether to download the snapshot version build from this remote warehouse

There is an attribute in releases and snapshots enabled, which is a boolean value. The default is true, indicating whether to download the stable version or the snapshot version from the remote warehouse. Generally, third-party warehouses are used to download the stable version.

Builds for snapshot releases -SNAPSHOTend with , stable releases do not have this flag.

example

Let's experience the effect of configuring remote warehouses in pom mode.

Open a text editor maven-chat03/pom.xmland paste the following into it:

<?xml version="1.0" encoding="UTF-8"?>
<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.javacode2018</groupId>
    <artifactId>maven-chat03</artifactId>
    <version>1.0-SNAPSHOT</version>

    <dependencies>
        <dependency>
            <groupId>com.alibaba</groupId>
            <artifactId>fastjson</artifactId>
            <version>1.2.62</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
            <version>2.2.1.RELEASE</version>
        </dependency>
    </dependencies>

    <repositories>
        <repository>
            <id>aliyun-releases</id>
            <url>https://maven.aliyun.com/repository/public</url>
            <releases>
                <enabled>true</enabled>
            </releases>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </repository>
    </repositories>

</project>

Above we configured a remote warehouse, the address is the address of Alibaba Cloud's maven warehouse, and the is releases, enabledwhich means truethat this remote warehouse is only allowed to download the stable version of the component, and cannot download the snapshot version of the build from this warehouse.snapshotsenabledfalse

Delete the following directories in the local warehouse:

~\.m2\repository\org\springframework
~\.m2\repository\com\alibaba

Open cmd in the maven-chat03 project directory and run:

mvn compile

The output is as follows:

D:\code\IdeaProjects\maven-chat03>mvn compile
[INFO] Scanning for projects...
[INFO]
[INFO] -------------------< com.javacode2018:maven-chat03 >--------------------
[INFO] Building maven-chat03 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
Downloading from aliyun-releases: https://maven.aliyun.com/repository/public/org/springframework/boot/spring-boot-starter-web/2.2.1.RELEASE/spring-boot-starter-web-2.2.1.RELEASE.pom
Downloaded from aliyun-releases: https://maven.aliyun.com/repository/public/org/springframework/boot/spring-boot-starter-web/2.2.1.RELEASE/spring-boot-starter-web-2.2.1.RELEASE.pom (3.3 kB at 5.1 kB/s)
Downloading from aliyun-releases: https://maven.aliyun.com/repository/public/org/springframework/boot/spring-boot-starters/2.2.1.RELEASE/spring-boot-starters-2.2.1.RELEASE.pom
Downloaded from aliyun-releases: https://maven.aliyun.com/repository/public/org/springframework/boot/spring-boot-starters/2.2.1.RELEASE/spring-boot-starters-2.2.1.RELEASE.pom (1.8 kB at 8.0 kB/s)
Downloading from aliyun-releases: https://maven.aliyun.com/repository/public/org/springframework/boot/spring-boot-parent/2.2.1.RELEASE/spring-boot-parent-2.2.1.RELEASE.pom
Downloaded from aliyun-releases: https://maven.aliyun.com/repository/public/org/springframework/boot/spring-boot-parent/2.2.1.RELEASE/spring-boot-parent-2.2.1.RELEASE.pom (1.8 kB at 8.6 kB/s)
Downloaded from aliyun-releases: https://maven.aliyun.com/repository/public/org/springframework/spring-expression/5.2.1.RELEASE/spring-expression-5.2.1.RELEASE.jar (282 kB at 82 kB/s)
Downloaded from aliyun-releases: https://maven.aliyun.com/repository/public/org/springframework/spring-webmvc/5.2.1.RELEASE/spring-webmvc-5.2.1.RELEASE.jar (946 kB at 219 kB/s)
Downloaded from aliyun-releases: https://maven.aliyun.com/repository/public/org/springframework/spring-beans/5.2.1.RELEASE/spring-beans-5.2.1.RELEASE.jar (684 kB at 56 kB/s)
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ maven-chat03 ---
[WARNING] Using platform encoding (GBK actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ maven-chat03 ---
[INFO] Changes detected - recompiling the module!
[WARNING] File encoding has not been set, using platform encoding GBK, i.e. build is platform dependent!
[INFO] Compiling 1 source file to D:\code\IdeaProjects\maven-chat03\target\classes
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  24.079 s
[INFO] Finished at: 2019-11-12T15:33:27+08:00
[INFO] ------------------------------------------------------------------------

There are many in the output Downloaded from aliyun-releases, Downloaded fromfollowed by aliyun-releasesthe id in the remote warehouse repository element we configured in pom.xml above, and you can see many download addresses later, this address is the remote warehouse we specified in pom.xml above Address, you can see that the builds that the project depends on have been downloaded from the remote warehouse we specified.

The way to configure the remote warehouse in the pom is only effective for the current project. If we need to work for all projects, we can use the following method 2 to look down.

7.2. Method 2

Mirrored way

If warehouse X can provide all the content of warehouse Y, then we can think that X is a mirror image of Y. In layman's terms, all components that can be obtained from Y can be obtained from his mirror image.

The remote warehouse can be configured by mirroring. The mirroring settings.xmlis configured in and takes effect for all maven projects that use this configuration. The configuration method is as follows:

<mirror>
  <id>mirrorId</id>
  <mirrorOf>repositoryId</mirrorOf>
  <name>Human Readable Name for this Mirror.</name>
  <url>http://my.repository.com/repo/path</url>
</mirror>

There can be multiple mirror elements under the mirrors element, and each mirror element represents a remote mirror. Element description:

  • id: the id of the image, which is an identifier

  • name: The name of the image, which is equivalent to a descriptive information, which is convenient for everyone to view

  • url: the address of the remote warehouse corresponding to the image

  • mirrorOf: Specifies which remote warehouse ids use this mirror, which corresponds to the id of the repository element in the pom.xml file, which means which remote warehouses in the pom.xml article this mirror is used for, and the remote warehouses need to be listed here id, separated by commas, *means to mirror all remote warehouses

Here we mainly explain mirrorOf again. When we define the remote warehouse in the project above, there is an id in the repository element of the pom.xml file. This id is the id of the remote warehouse, and mirrorOf is used to configure which remote warehouses will Take this mirror to download components.

The configuration of mirrorOf has the following types:

<mirrorOf>*</mirrorOf> 

The above matches all remote warehouse ids, and these remote warehouses will use this mirror to download components

<mirrorOf>远程仓库1的id,远程仓库2的id</mirrorOf> 

The above matches the specified warehouse, and these specified warehouses will use this mirror to download components

<mirrorOf>*,! repo1</mirrorOf> 

The above matches all remote repositories except repo1, use the exclamation point to remove the repo from matching.

It should be noted that the mirrored warehouse completely shields the mirrored warehouse, so when the mirrored warehouse is unavailable, maven cannot automatically switch to the mirrored warehouse, and the download of components will fail at this time, which needs to be understood.

example

Modify pom.xml in maven-chat03 to:

<?xml version="1.0" encoding="UTF-8"?>
<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.javacode2018</groupId>
    <artifactId>maven-chat03</artifactId>
    <version>1.0-SNAPSHOT</version>

    <dependencies>
        <dependency>
            <groupId>com.alibaba</groupId>
            <artifactId>fastjson</artifactId>
            <version>1.2.62</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
            <version>2.2.1.RELEASE</version>
        </dependency>
    </dependencies>

</project>

Modify ~/.m2/settings.xml and add mirror configuration, as follows:

<mirrors>
    <mirror>
        <id>mirror-aliyun-releases</id>
        <mirrorOf>*</mirrorOf>
        <name>阿里云maven镜像</name>
        <url>https://maven.aliyun.com/repository/public</url>
    </mirror>
</mirrors>

A mirror image of Alibaba Cloud is configured above. Note that the id of the mirror image ismirror-aliyun-releases

Next, let's verify the effect of mirroring.

Delete the following directories in the local repository:

~\.m2\repository\org\springframework
~\.m2\repository\com\alibaba

Open cmd in the maven-chat03 project directory and run:

mvn compile

The output is as follows:

D:\code\IdeaProjects\maven-chat03>mvn compile
[INFO] Scanning for projects...
[INFO]
[INFO] -------------------< com.javacode2018:maven-chat03 >--------------------
[INFO] Building maven-chat03 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
Downloading from mirror-aliyun-releases: https://maven.aliyun.com/repository/public/com/alibaba/fastjson/1.2.62/fastjson-1.2.62.pom
Downloaded from mirror-aliyun-releases: https://maven.aliyun.com/repository/public/com/alibaba/fastjson/1.2.62/fastjson-1.2.62.pom (9.7 kB at 17 kB/s)
Downloading from mirror-aliyun-releases: https://maven.aliyun.com/repository/public/org/springframework/boot/spring-boot-starter-web/2.2.1.RELEASE/spring-boot-starter-web-2.2.1.RELEASE.pom
Downloaded from mirror-aliyun-releases: https://maven.aliyun.com/repository/public/org/springframework/boot/spring-boot-starter-web/2.2.1.RELEASE/spring-boot-starter-web-2.2.1.RELEASE.pom (3.3 kB at 15 kB/s)
Downloading from mirror-aliyun-releases: https://maven.aliyun.com/repository/public/org/springframework/boot/spring-boot-starters/2.2.1.RELEASE/spring-boot-starters-2.2.1.RELEASE.pom
Downloaded from mirror-aliyun-releases: https://maven.aliyun.com/repository/public/org/springframework/boot/spring-boot-starters/2.2.1.RELEASE/spring-boot-starters-2.2.1.RELEASE.pom (1.8 kB at 8.3 kB/s)
Downloading from mirror-aliyun-releases: https://maven.aliyun.com/repository/public/org/springframework/boot/spring-boot-parent/2.2.1.RELEASE/spring-boot-parent-2.2.1.RELEASE.pom
Downloaded from mirror-aliyun-releases: https://maven.aliyun.com/repository/public/org/springframework/boot/spring-boot-parent/2.2.1.RELEASE/spring-boot-parent-2.2.1.RELEASE.pom (1.8 kB at 8.2 kB/s)
Downloading from mirror-aliyun-releases: https://maven.aliyun.com/repository/public/org/springframework/boot/spring-boot-dependencies/2.2.1.RELEASE/spring-boot-dependencies-2.2.1.RELEASE.pom
Downloaded from mirror-aliyun-releases: https://maven.aliyun.com/repository/public/org/springframework/boot/spring-boot-dependencies/2.2.1.RELEASE/spring-boot-dependencies-2.2.1.RELEASE.pom (127 kB at 311 kB/s)
Downloading from mirror-aliyun-releases: https://maven.aliyun.com/repository/public/org/springframework/spring-framework-bom/5.2.1.RELEASE/spring-framework-bom-5.2.1.RELEASE.pom
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ maven-chat03 ---
[WARNING] Using platform encoding (GBK actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ maven-chat03 ---
[INFO] Nothing to compile - all classes are up to date
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  15.967 s
[INFO] Finished at: 2019-11-12T16:44:57+08:00
[INFO] ------------------------------------------------------------------------

Part of the content is copied above. If you take a closer look , Downloaded fromthe display is that mirror-aliyun-releasesthis is consistent with the id of the image in settings.xml, indicating that the image we configured has taken effect, and all dependent builds are obtained from the image.

A common use of mirroring is to use it with private servers. Since private servers can proxy all remote warehouses (including the central warehouse), for maven users, all external remote warehouses can be indirectly accessed by accessing only one private server. We will explain this in detail later in the private server.

Guess you like

Origin blog.csdn.net/qq_34272760/article/details/127093199