Maven repository category, maven Repository

Source: Internet
Author: User

Maven repository category, maven Repository

MAVEN repository category

 

Maven repositories can be divided into local warehouses and remote warehouses.

 

Remote warehouses are divided into central warehouses, private servers, and other public remote warehouses.

 

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

 

2. Maven stores shared components of all projects in a unified location. This unified location is called a repository. (The repository stores dependencies and plug-ins)

 

3. Any component has unique coordinates. Maven defines the unique storage path of the component in the repository based on the coordinates.

 

4. The local repository refers to the place where Maven stores the components locally (maven's local repository is not created after maven is installed. It is created when maven command is executed for the first time)

 

5. When maven looks for components, it first looks for them from the local warehouse. If they cannot be found in the local warehouse, it will look for them in the remote warehouse. If the remote warehouse cannot be found, an error will be reported, find the remote repository and download it to your local device for use. As maven continues to use download components, its local repository will become larger and larger.

 

6. A component can be used by other Maven projects only after it is in the local repository.

 

7, the central repository is maven built-in remote repository, default address: http://repol.maven.org/maven2

 

8. A private server is a special remote warehouse built on a local machine or lan. It allows you to conveniently manage all other external remote warehouses.

 

9. The default address of the local repository is $ {user: home}/. m2/repository.

 

10. Add a remote repository to the project. When the central repository cannot find the required component, we can configure pom. xml file, add other remote repositories, where the IDS must be unique (if not unique, set to central to overwrite the central repository)

 

11. By default, in either windows or linux, each user has a repository directory named. m2/repository/under his/her own user directory. Sometimes, for some reason (such as insufficient disk space), you need to modify the settings. xml configuration file to customize the local repository directory address. (After this change, all users will be affected. If maven is upgraded, all configurations will be cleared. Therefore, you must copy and back up M2_HOME/conf/settings in advance. xml file. Therefore, it is generally not recommended to configure global settings. xml)

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.