Maven projects are often seen on the Forum, and you never know what Maven is. When I was idle recently, I went online and looked for information.
Its official website: http://maven.apache.org/
1. Introduction
Maven is based on the project object model POM. It is a tool used to manage project construction, reports, and documents. It is a project management tool. Maven has a lifecycle, which is called when you run mvn install. This command tells Maven to execute a series of ordered steps until it reaches your specified lifecycle. One of the effects of traversing the lifecycle journey is that Maven runs many default plug-in targets that complete compilation and creation of a JAR file.
In addition, Maven can easily help you manage project reports, generate sites, manage JAR files, and so on.
2. Establish the environment
There are two ways to configure the maven environment: Do not use the local maven Installation File environment configuration, use the local maven environment. The second method is used here. Before installing Maven, make sure that your JDK has been installed and configured. First
Go to the official website to download Maven. Configure the maven environment variable.
System variable: MAVEN_HOME = D: \ Program Files \ apache-maven-3.0.4
System variable: path = % MAVEN_HOME % \ bin
I believe that everyone has been equipped with environment variables. The detailed steps are not mentioned, and the attribute name and attribute value are matched with OK.
Open cmd and press mvn-version. If you can print the version information, the configuration is successful.
3. Build a Maven plug-in Eclipse
A. Window --> Preferences find Installations under Maven, click Add on the right side, and select the path to install Maven on your local machine.
B. In Preferences --> Maven --> User Settings, click Update Settings to load the changes we just made to settings. xml.
4. Modify the storage location of the maven local repository
A. Find the settings. xml configuration file under conf In the Maven installation path and set it to the repository path we created. By default, the repository is stored in the. m2 folder under the temporary folder of the local user.
-------------------- Of course, you can also use the Maven plug-in ----------------------------------- that comes with MyEclipse -----------------------------------
-
650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131228/15210L012-0.gif "border =" 0 "class =" absmiddle "style =" margin: 0px 0px-4px; padding: 0px; border: medium none; "alt =" image.gif "/> 1.png
(91.82 KB)
-
650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131228/15210I440-1.png "alt =" 1.png" style = "margin: 0px; padding: 0px; border: medium none;"/>
-
650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131228/15210L012-0.gif "border =" 0 "class =" absmiddle "style =" margin: 0px 0px-4px; padding: 0px; border: medium none; "alt =" image.gif "/> 2.png
(72.78 KB)
-
650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131228/15210J047-3.png.thumb.jpg "alt =" 2.png" style = "margin: 0px; padding: 0px; border: medium none;"/>
-
650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131228/15210L012-0.gif "border =" 0 "class =" absmiddle "style =" margin: 0px 0px-4px; padding: 0px; border: medium none; "alt =" image.gif "/> 3.png
(11.27 KB)
-
650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131228/15210G015-5.png "alt =" 3.png" style = "margin: 0px; padding: 0px; border: medium none;"/>