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>