Maven (download, installation, environment configuration detailed graphics)

It is a blogger's honor to help you solve problems, and your support is the biggest motivation for my creation! :) Welcome to follow and like

1. Download Maven

Tip: Before installing, you need to confirm which version of maven you need to avoid wasting time.

Official website download:
https://maven.apache.org/download.cgi
Baidu cloud disk download:
Link: https://pan.baidu.com/s/11QMCZyOPKCHD8-dqA87wHA
Extraction code: 1we2

Official website download tutorial
1. First open https://maven.apache.org/download.cgi, find the download for windows, the blogger directly downloads the latest version.

insert image description here

2. If you want to choose other versions, click "archives" to find the corresponding version and download it. Here we take 3.6.0 as an example.

insert image description here
insert image description here

Select binaries, the windows system selects the download with the suffix .zip and it is available.
insert image description here
insert image description here
The file looks like this after a successful download.

insert image description here

Two, Maven configuration

1. Right-click My Computer->Properties->Advanced System Settings->Environment Variables.

insert image description here

2. Configure two variables M2_HOME and MAVEN_HOME, M2_HOME will be used in subsequent development.

insert image description here
insert image description here

3. Add %M2_HOME%\bin and %MAVEN_HOME%\bin to Path, and click OK.

insert image description here

4. After configuration, click "OK", then click "Apply" and "OK", and the Maven configuration is complete.

insert image description here
insert image description here

3. Verification

1. Open win+R and enter cmd.

insert image description here

2. Enter mvn -v, after seeing the version number and related information, congratulations on completing the installation and environment configuration of maven! !

insert image description here

Four, Maven warehouse settings (setting.xml settings)

1. Find the conf folder in the maven installation directory.

insert image description here

2. Open the setting.xml file.

insert image description here

3. Create a new folder as a local warehouse, that is, the jar package downloaded by the project will be saved to the local warehouse. Set path in localRepository tag.

insert image description here

4. Set up the Alibaba Cloud central warehouse image. So far, the basic configuration of the maven part can basically meet the development needs.

<mirror>
	<id>nexus-aliyun</id>
	<name>nexus-aliyun</name>
	<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
	<mirrorOf>central</mirrorOf>       
</mirror>

insert image description here


Summarize

1. There are also problems encountered during the environment configuration process. First, I will list a problem I have encountered: The JAVA_HOME environment variable is not defined correctly.
The detailed solutions have been listed in other articles. If you have other questions, please come to discuss them.

Guess you like

Origin blog.csdn.net/King_Treasure/article/details/127895647