Maven installation configuration

The Maven tool is a powerful project management tool. Effective use of Maven will greatly improve the efficiency of code production.

Install Maven

Go to the https://maven.apache.org/download.cgi website, because I am a windows system, and I downloaded bin.zip. After the download is complete, decompress it to the specified directory. After decompression, the document structure is as follows:

image

--bin: Save the executable commands of Maven, mvn and mvn.bat are the commands to execute the Maven tool.

--boot: This directory contains only one plexus-classworlds-2.5.2.jar, plexus-classworlds-2.5.2.jar is a class loading framework.

--conf: The directory where Maven configuration files are kept, this directory contains the setting.xml file, which is used to set the global behavior of Maven.

--lib: This directory contains all the class libraries required for Maven to run, and also contains third-party class libraries that Maven depends on.

--LICENSE, README.txt and other documentation.

Configure Maven

Maven needs to configure the following two environment variables:

JAVA_HOME: This environment variable points to the JDK installation path.

MAVEN_HOME: This environment variable points to the MAVEN installation path.

It is best to add it to the PATH environment variable: PATH: ;%MAVEN_HOME%\bin;

an examination

After the installation and configuration is complete, execute the mvn -v command on the command line, and the following results will be output:

C:\Users\wpx>mvn -v
Apache Maven 3.5.3 (3383c37e1f9e9b3bc3df5050c29c8aff9f295297; 2018-02-25T03:49:05+08:00)
Maven home: D:\SoftWare\apache-maven-3.5.3\bin\..
Java version: 1.8.0_151, vendor: Oracle Corporation
Java home: D:\SoftWare\jdk1.8.0_151\jre
Default locale: zh_CN, platform encoding: GBK
OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"

If you see similar results, it means that Maven has been installed and configured successfully on Windows.

Configure Maven in IDEA

Open File-Settings and change the Maven configuration
image

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325087525&siteId=291194637