Graphical Maven installation and configuration


1. Download

MavenThe download is very simple, go directly to Baidu search Mavenand enter the Mavenofficial website, as shown in the red box in the following figure:
Insert picture description here
Click to enter the official website or click me directly , and click on the left Downland:

Insert picture description here
Then click as shown in the figure below apache-maven-3.6.3-bin.zip, which is to download the mavencompressed package
Insert picture description here

After the download is complete, unzip it to D盘(the path must be in English! ), the file directory should look like this: So
Insert picture description here
far, the Maveninstallation is complete!

Two, configure environment variables

Now configure the environment variable, Javajust like the configured environment. First 右键此电脑, click 属性, then click 高级系统设置: After
Insert picture description here
clicking in, click first 高级, then click 环境变量:
Insert picture description here
Then click the box below 系统变量, there is one 新建, click once, and a dialog box will pop up:
Insert picture description here
Insert picture description here
Fill in variable name :M2_HOME

Variable value fill: Maventhe 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: Maventhe installation location, such as:, D:\apache-maven-3.6.3as shown in the figure below:
Insert picture description here
At this moment, two variables should be created in the system variable box, as shown in the figure below:
Insert picture description here
Then, find it in this box Path, click Edit: After
Insert picture description here
clicking 编辑, create new, Input %MAVEN_HOME%\bin, as shown in the figure below:
Insert picture description here
At this point, the environment variable configuration is successful, you can open it now cmd, input mvn -version, and take a look:
Insert picture description here
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 Maveninstallation directory, there is a conffolder with setting.xmlfiles in it, right click to edit.
Insert picture description here
Press directly Ctrl+F, enter mirrors, find the tag
Insert picture description here
, 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.xmlfile, press Ctrl+F, type localRepository, find this thing

Insert picture description here
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 Maveninstallation directory and create a maven-repofolder named : The
Insert picture description here
local warehouse is successfully configured!

Guess you like

Origin blog.csdn.net/lesileqin/article/details/112792828