1. Download the installation package
Download the latest version of the installation package on the MAVEN website: http://maven.apache.org/download.cgi
2. Unpack the installation package 3, configure the MAVEN environment variable
Configure the M2_home environment variable, point to the MAVEN installation directory, and append the bin directory to the path path for easy invocation at the command line.
Windows:
Linux:
Add the MAVEN environment variable in the/etc/profile file as follows:
export M2_HOME=/opt/mavenexport PATH=$PATH:$M2_HOME/bin
4. Verification
Execute mvn–version at the command line, if the displayed information indicates that MAVEN has been successfully installed
5, copy the global configuration file to the user directory
Copy the%m2_home%\config\settings.xml file to the%USER_HOME%.M2 directory for the current user to override the global settings for MAVEN settings.
6. Modify the IDE's built-in maven
To ensure consistency in the command line execution of the MVN command and the MVN command executed in the IDE, you need to modify the IDE's built-in maven for our own download
1> Eclipse/myeclipse (both Eclipse and myeclipse use the M2eclipse plug-in, set up the same way):
Take the Eclipse4.5 version of the Java EE version as an example:
Window–> preferences–> Enter maven–> in the Filter box installations–> add and select the maven you downloaded on the right. As shown in the following:
MAVEN Installation and Environment configuration (Windows)