MAVEN Basics-Default Central warehouse _maven

Source: Internet
Author: User

When we create a simple MAVEN project (which only needs to be configured in Pom.xml), running mvn clean install can build the project, without having to download any jars manually, depending on the presence of the central repository, which is automatically downloaded from the warehouse. The definition of this warehouse is in ${m2_home}/lib/maven-2.0.10-uber.jar . You can find the \org\apache\maven\project\pom-4.0.0.xml  file inside this file, which defines the default central warehouse address:

XML code <repositories> <repository> <id> central</id> <name> Maven Repository switchboard</name> <layout> default</layout> <url> Http://repo1.maven .org/maven2</url> <snapshots> <enabled> false</enabled> </snapshot S> </repository> </repositories>

If you want to overwrite the default address of the central warehouse, then we will use the mirror here, also in the Setting.xml configuration:

XML code <settings> ... <mirrors> <mirror> <id> MAVEN-NET-CN</ID&G            T             <name> Maven mirror</name> <url> http://maven.net.cn/content/groups/public/</url> <mirrorOf> central</mirrorof> </mirror> </mirrors> ... </se Ttings>

<mirrorof>, which represents only mirrors for the warehouse, and if you want to mirror all of the warehouses, you can change to:

<mirrorOf>*</mirrorOf>

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.