Maven Advanced—Private Server

Function and introduction

There are two project teams in a company. If one of them develops a dependency on tlias-utils, if the other project team wants to use it, it must be passed over and installed directly into its own local warehouse.

However, it is also possible to set up a public warehouse for internal use of the company's LAN, which is the so-called private server.

Then when importing dependencies, it will first go to the local warehouse to find it. If the local warehouse cannot find it, it will go to the private server to find it. If there is no private server, the private server will automatically connect to the central warehouse to search.

 Resource upload and download 

To access the private server, you need a username and password, and then you need to know the url address of the uploaded resource. With these two pieces of information, the local jar package can be published to the private server.

When downloading the jar package of the private server, you also need to configure the url address of the private server in Maven. Only in this way can the local warehouse automatically connect to the private server to find resources.

There are different types of warehouses in private servers. For example, central is the global central warehouse.

There are also two warehouses, one for the stable version and one for the development version.

It can be seen that the versions of the previously split modules are all SNAPSHOT, and the suffix is ​​changed to RELEASE or the suffix is ​​deleted, and it will be released to the warehouse of the stable version.

 

Step 1 - Set Username and Password

There are two sets of user names and passwords, one for the releases warehouse and one for the snapshots warehouse.

Step 2 - Configure the resource upload address

This also needs to configure two versions of the address.

Step 3 - Set the address of the repository group for downloading resources.

There are multiple warehouses in the private server, and when the required resources are not clear which warehouse is located, it is directly divided into a warehouse group, and it will be automatically searched in the warehouse group. 

It is also necessary to specify in the profiles that both the stable version and the unstable version can be downloaded, because by default, the unstable version of snapshots is not allowed to be downloaded from private servers. 

 

As for the specific operation, I will explain in detail after I learn Maven private server and build a private server. There is no condition now.

It seems that you can also install a private server in the local warehouse, forget it, don’t do it.

Flowers are over!

Guess you like

Origin blog.csdn.net/m0_62327332/article/details/131033319