Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to build Private Library in Maven

2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

It is believed that many inexperienced people have no idea about how to build a private database in Maven. Therefore, this paper summarizes the causes and solutions of the problem. Through this article, I hope you can solve this problem.

Why use private libraries?

Maven default to remote central warehouse to download JAR package, access to foreign networks is quite slow, if everyone on the team to download once is undoubtedly a waste of the network, of course, you can also add domestic images, such as Ali relatively stable, but if you want to add remote non-existent JAR package like a third-party company is more troublesome.

Therefore, to use a private library, first, as long as one person has downloaded the open source package, others do not need to download it, just download it directly from the private library. Second, it can be used to manage JAR packages of third-party companies or remote repositories, or JAR packages that are not open source by the company.

Recommend stable domestic images, such as Ali's

Http://maven.aliyun.com/nexus/content/groups/public/

Download and install nexus

First of all, go to the sonatype official website to download the nexus package, to download the open source free version of the OSS version, namely Open Source Software.

Https://www.sonatype.com/nexus-repository-oss

Download the latest 3.x version, which is downloaded here with windows as an example.

After download, click the startup file in the bin directory. The default port is 8081 and the access path is /. You can also modify it in the configuration file, which is the default here.

After startup, open localhost:8081,nexus. The default user name is admin/admin123.

The following warehouses are installed by default, and the address of the remote warehouse and the third-party warehouse can also be modified in the console.

Maven configuration

Modify the maven home directory conf/setting.xml configuration file.

Add user name and password configuration information for nexus authentication.

Nexus-releases

Admin

Admin123

Nexus-snapshots

Admin

Admin123

Add mirror Mirror

Nexus

*

Nexus

Http://127.0.0.1:8081/repository/maven-public/

Add a private library

Nexus

Nexus

Nexus

Http://127.0.0.1:8081/repository/maven-public/

True

True

Nexus

Nexus

Http://127.0.0.1:8081/repository/maven-public/

True

True

Activate the private library

Nexus

Publish to private database

Add to the pom configuration file

Nexus-releases

Nexus Releases Repository

Http://localhost:8081/nexus/content/repositories/releases/

Nexus-snapshots

Nexus Snapshots Repository

Http://localhost:8081/nexus/content/repositories/snapshots/

After reading the above, have you mastered the method of how to build a private database in Maven? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report