Here maven to use for the eclipse, so you need to make sure you are a computer and have eclipse installed JDK and configured the environment variables can be used normally.
First, download
the proposal directly Quguan network download: https://maven.apache.org/download.cgi
Note: You may consider using the latest version, mainly for stability of the software.
1, here is the latest version available direct
, 2, of course, we can also find the version of history, looking down you will find archives,
3, click on the archives, you can see all the historical versions, here I chose 3.6 .1 version
4. Once you have downloaded only need to unzip it. My installation path is: D: \ java \ maven \ apache-maven-3.6.1
Second, the configuration environment variable
1, variable in the new system environment variables and assigns
the variable name: MAVEN_HOME,
variable value: D: \ java \ maven \ apache-maven-3.6.1 ( own installation path of maven)
2, editing environment variable Path, added:% MAVEN_HOME% \ bin
3, maven so far has been installed and configured the environment variables, check whether the installation was successful by DOS commands using the command: mvn -v
this way, you can successfully display the version information that shows that when successfully installed
Third, configure maven local repository
1, in your installation path (mine is: D: \ java \ maven \ apache-maven-3.6.1) , the new repository folder to the local maven repository
2, found settings.xml file in the installation path, as: D: \ java \ maven \ conf directory \ Apache-3.6.1-Maven
. 3, with Notepad, shortcut keys Ctrl + F can be found to find the following a piece of code
<localRepository>/path/to/local/repo</localRepository>
localRepository default node is commented out, it needs to move beyond the notes, now you need to value localRepository node to the directory created before D: \ the Java \ Maven \-the Apache Maven-3.6.1 \ Repository
4, localRepository node is used to configure a local warehouse, local warehouse in fact, played a buffer role, its default address is C: \ users \ username .m2.
When we get the package from the jar maven in time, maven will first look in the local warehouse, if the local warehouse is returned; if not from the remote repository to obtain package and stored in a local library.
In addition, we run mvn install in a maven project, the project will be automatically packaged and installed to the local repository. . .
4, run the DOS command
mvn help:system
Configuration is successful, then your repository folder there will be some file path: D: \ java \ maven \ apache-maven-3.6.1 \ repository
Fourth, configured to eclipse maven environment
1, followed by Window-> Preferences-> Maven-> Installations, click on the right side of the Add
, 2, set up maven installation directory, and then click Done
3, select the maven just added, and click Apply and Close
4. open Window-> Preferences-> Maven-> User Settings , arranged below and click Apply and close
Now, you can start your tour of the code