How to build maven environment variables?

If you want to play spring boot, you must first configure the maven environment variables. The following will teach you how to configure the maven environment variables
1. Download and install
1.1 First, go to the official website http://maven.apache.org/download.cgi to download the latest version, After the download is complete, unzip it to a directory, (mine is in the D:\apache-maven-3.6.1-bin\apache-maven-3.6.1 directory) After the
download is complete, change the maven library to Alibaba Cloud library:
Open the settings.xml under D:\apache-maven-3.6.1-bin\apache-maven-3.6.1\conf, find mirrors,

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

Paste the above configuration confidence as shown in the figure:
Insert picture description here
Save as shown !
2.1 Configure environment variables In the
system environment variables, add MAVEN_HOME (or M2_HOME), the value is C:\Java\maven-3.1.1, and then the PATH environment variable is appended at the end On ";%MAVEN_HOME%\bin" ( Note: the preceding semicolon may not be needed ) as shown in the figure:
Insert picture description here
Insert picture description hereInsert picture description here
Detection method:
a) Re-enter the command line (DOS window) mode, enter echo %MAVEN_HOME%, if it can display C:\ Java \ maven-3.1.1 Description environment variables play a role
b) enter mvn -version, it will show maven and jdk version number (provided under normal circumstances: jdk environment must be installed, otherwise the back will not compile the project)
Insert picture description hereat this time , The environment variables have been configured successfully!

Guess you like

Origin blog.csdn.net/lq1759336950/article/details/93384688