Maven installation configuration

One: download maven

Maven official download URL: click me to download
Insert picture description here

Two: configuration in environment variables

Click me to view: The difference between user variables and system variables in windows environment variables

First we need to configure JAVA_HOME (jdk directory: D:\java_jdk)
Next we configure MAVEN_HOME (maven directory: D:\apache-maven-3.6.3)
Insert picture description here

Next we need to configure MAVEN_HOME\bin to the path
Insert picture description here

Three, check the mvn installation

Enter the cmd command line, enter: mvn -version, the following code appears to indicate successful installation
Insert picture description here

Four, configure maven warehouse

Open our maven directory, find config in the maven directory, and find settings.xml in the config directory.
Take my maven as an example: D:\apache-maven-3.6.3\conf\settings.xml
Insert picture description here
and add a sentence to it : <LocalRepository> d:/mavenidea </ localRepository>
The jar packages downloaded by mvn are all in this.
Note that if there is already localRepository in the file, then we need to comment out the original

Guess you like

Origin blog.csdn.net/xiaozhezhe0470/article/details/109025420