1. Basic environment
Operating system: Windows 10 (64-bit)
JDK version: 1.8.0_191 (64-bit)
Eclipse version: Eclipse Java EE IDE for Web Developers 4.9.0
2. Introduction
Apache Maven is an open-source development services in the Java platform build tool automation and project management tools , it contains a project object model (Project Object Model), a set of standards, a project life cycle (Project Lifecycle), a dependency management system (Dependency management system), and used to run the definition of the life cycle stage (phase) plug-in logic (plugin) target (goal) is. When you use Maven, you use a clearly defined project object model to describe your project, and then Maven can apply cross-cutting logic that comes from a set of shared (or custom) plugins.
Maven has a life cycle, which is called when you run mvn install. This command tells Maven to perform a series of orderly steps until it reaches the life cycle you specify. One effect of the journey through the life cycle is that Maven runs a number of default plugin goals that complete tasks like compiling and creating a JAR file.
Core idea: Convention is greater than configuration.
Three, download
The official homepage of Maven: https://maven.apache.org/ download address: https://maven.apache.org/download.cgi
Please refer to the correspondence between Maven and JDK version: http://maven.apache.org/docs/history.html
After using the browser to open the download address, in the [Files] column, download the corresponding files according to your operating system and needs. Please choose something similar to apache-maven-XXX-bin.zip for Windows platform.
Four, installation
After the download is complete, unzip the file to: D:\ProgramFiles\Apache\maven to complete the installation.
Five, configuration
A. Configure environment variables
1. Right-click [This Computer], select [Properties], and click [Advanced System Settings] on the left to switch to the [Advanced] tab. Click [Environmental Variables...] below.
2. Click [New] under System Variables, and enter: MAVEN_HOME [Variable Value] in [Variable Name] (the installation path of MAVEN): D:\ProgramFiles\Apache\maven, and then click [OK].
3. Select the line of [Path], and then click [Edit]. Then in the pop-up window, click the [New] button. Input: %MAVEN_HOME%\bin and then click [OK] to close the window.
B. Eclipse configuration
1. Click [Window]-[Preferences] in the menu bar in turn, enter: maven in the search box on the upper left side, then click [Installations], click [Add...] on the right side, in the pop-up window, [Installation home ] Input: D:\ProgramFiles\Apache\maven [Installation name] Input: maven and then click [Finish] to return to the previous page, and check the newly installed maven.
2. Click [User Settings] on the left, click [Browse...] behind [Global Settings] to find Maven's global configuration file: settings.xml, then click [Open], and [User settings] do the same settings.
3. Then click [Apply and Close] below to complete the configuration.