1. What is maven
Maven is an open source project developed in pure Java under Apache. Based on the concept of the project object model (abbreviation: POM), Maven uses a central piece of information to manage the construction, reporting, and documentation steps of a project. Maven is a project management tool that can build and depend on Java projects.
2. Functions of Maven
Maven can help developers complete the following tasks:
- Construct
- Document generation
- report
- rely
- SCMs
- release
- distribution
- Mailing Lists
3. Maven download and installation
The Maven download URL is: http://maven.apache.org/download.cgi
Version selection:
Select the path to unzip, for example: C:\Program Files\Apache\maven
4. Environment variable configuration
Right-click this computer---->Properties---->Advanced System Settings---->Environment Variables
New variable: MAVEN_HOME, assignment: C:\Program Files\Apache\maven
Add this variable in PATH: %MAVEN_HOME%\bin
Save after confirmation.
5. Test whether the installation is successful
Open the cmd window, enter mvn --version, and see the version information to indicate that the configuration is successful.
6. Installation failed
After entering mvn --version, if the following message appears, the configuration has failed.
This problem is due to the incorrect configuration of JAVA_HOME path. The user variable JAVA_HOME path must be the same as the system variable JAVA_HOME path. According to the above method, check whether the JAVA_HOME variable has been set in the environment variable. If not, add the JAVA_HOME variable and assign the value to jdk installation Path, for example: C:\Program Files\Java\jdk-14.0.2.
After configuration, click OK, reopen the cmd window, test mvn --version again, and it succeeds.