Article Directory
1. Download
Maven
The download is very simple, go directly to Baidu search Maven
and enter the Maven
official website, as shown in the red box in the following figure:
Click to enter the official website or click me directly , and click on the left Downland
:
Then click as shown in the figure below apache-maven-3.6.3-bin.zip
, which is to download the maven
compressed package
After the download is complete, unzip it to D盘
(the path must be in English! ), the file directory should look like this: So
far, the Maven
installation is complete!
Two, configure environment variables
Now configure the environment variable, Java
just like the configured environment. First 右键此电脑
, click 属性
, then click 高级系统设置
: After
clicking in, click first 高级
, then click 环境变量
:
Then click the box below 系统变量
, there is one 新建
, click once, and a dialog box will pop up:
Fill in variable name :M2_HOME
Variable value fill: Maven
the bin directory of your installation location, such as:D:\apache-maven-3.6.3\bin
Then the same steps,新建系统变量
Fill in the variable name:MAVEN_HOME
The variable value is: Maven
the installation location, such as:, D:\apache-maven-3.6.3
as shown in the figure below:
At this moment, two variables should be created in the system variable box, as shown in the figure below:
Then, find it in this box Path
, click Edit: After
clicking 编辑
, create new, Input %MAVEN_HOME%\bin
, as shown in the figure below:
At this point, the environment variable configuration is successful, you can open it now cmd
, input mvn -version
, and take a look:
If the version information appears, the configuration is successful.If the configuration is not successful according to the above steps, you can leave a message in the comment area, and I will answer as soon as I see it (I will answer it)
Three, configure Alibaba Cloud image
Find the Maven
installation directory, there is a conf
folder with setting.xml
files in it, right click to edit.
Press directly Ctrl+F
, enter mirrors
, find the tag
, add the following code in the tag body:
<mirror>
<id>nexus-aliyun</id>
<mirrorOf>central</mirrorOf>
<name>Nexus aliyun</name>
<url>http://maven.aliyun.com/nexus/content/groups/public</url>
</mirror>
Alibaba Cloud image configuration is successful!
4. Local warehouse
Still in the setting.xml
file, press Ctrl+F
, type localRepository
, find this thing
Fill in the following code in the above empty box:
<localRepository>D:\apache-maven-3.6.3\maven-repo</localRepository>
Then go back to the Maven
installation directory and create a maven-repo
folder named : The
local warehouse is successfully configured!