Maven + Alibaba cloud creates a central warehouse for domestic images (available for personal testing)

As we all know, one of the headaches in wall development is that the connection speed of Maven warehouse is too slow. Although for many Internet enterprises and large and medium-sized software companies, building a mirror is a matter of minutes. But it's a problem for individual developers and small companies. For a while ago, open source China provided Maven warehouse images, but they are no longer available.

The following is the test record of senior brother

Modify the setting in the conf folder under the root directory of Maven XML file, if you modify the storage location of the default warehouse like me, that is There is no local warehouse under M2 folder, but there is a setting XML file, then modify this file.

The specific contents and schematic diagram are as follows:

Then compare the two pictures to see the download speed. Everyone in the company is limited to 2m bandwidth.

As mentioned above, it is indeed seen in aliyun Download things. Com.

Then, look at the download speed. From the empty to the end of the download, it takes a little more than ten minutes. In the middle, I talked about QQ and came back. It must be about ten minutes.

Finally, the comparison between the original warehouse and the newly downloaded warehouse of the project is shown:

It is found that there are still many jar packages that have not been downloaded. It is estimated that they are similar to POM The configuration in the XML file has something to do with it.

Then, compare log4j Jar folder; The details are shown in the figure below: it means I can't understand it. I've just read this Maven and haven't finished it yet. Although Maven is used in the project, it's not very clear.

If any eldest brother knows the difference of the comparison chart below, please give me some advice.

pom. The configuration of log4j in XML is as follows: it seems nothing special. The problem should not be doing this.

In the figure, on the left is the local warehouse newly downloaded from Alibaba cloud. Why don't you have a new jar package? The difference is a little big.

For the time being, it is considered that the reasons are as follows: (if it is inappropriate, correct it again)

Either the remote warehouse didn't download it, or it didn't download it. It was downloaded to the local warehouse according to the dependencies in the POM.

(I just went to test it again, just simply add a dependency in the pom.xml file, that is, introduce a package.)

On this site, search for POM Dependencies in XML files. http://mvnrepository.com

Then in POM Add the above dependencies to the XML file; That is, the part selected in blue will be automatically downloaded to the local warehouse. The specific comparison is shown in the following figure;

3.5 this folder is modified POM After the XML file is created, the generated file is automatically created and downloaded. Then the documents inside are complete. Contains the jar package file.

The above is the whole content of this article. I hope it will be helpful to your study, and I hope you can support programming tips.

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>