1. Global configuration

1. Locate the Settings. XML file in the Maven installation directory

2. Add alicloud mirrors under the <mirrors></mirrors> TAB

	 <mirror>
    <id>alimaven</id>
    <name>aliyun maven</name>
    <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
    <mirrorOf>central</mirrorOf>       
</mirror>
Copy the code

As shown in figure:

 

Two, single project configuration

Single item configuration

  <repositories>
        <repository>
            <id>central</id>
            <name>aliyun maven</name>
            <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
            <layout>default</layout> <! Enable releases to download --> releases>true</enabled> </releases> <! Call it "snapshots" --> <snapshots> <enabled>false</enabled>
            </snapshots>
        </repository>
    </repositories>
Copy the code

Summary: There are two ways for Maven to configure Ali Cloud image.

Global configuration: Configure maven installation path /conf/settings. XML and add aliyun image code

Single project configuration: Configure the pom. XML file of the project and add ali Cloud image code