1. Using Maven in Eclipse:
A, the Maven plugin in Eclipse is built-in.
b, settings for the Maven plugin, set two items in Windows----Preferences----Maven:
650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M02/95/CD/wKiom1kZwl7RldyAAABFu7sQnRg701.png "title=" 00. PNG "alt=" Wkiom1kzwl7rldyaaabfu7sqnrg701.png "/>
650) this.width=650; "src=" Https://s5.51cto.com/wyfs02/M02/95/CD/wKiom1kZwl7RpRWPAAAVvFgqhbU721.png "title=" 01. PNG "alt=" Wkiom1kzwl7rprwpaaavvfgqhbu721.png "/>
Note: In installations, click Add ..., and then set your own apache-maven-3.2.2 installed as the installation directory.
650) this.width=650; "src=" Https://s1.51cto.com/wyfs02/M00/95/CD/wKiom1kZw3Lhz84cAAA56wqBtZA207.png "title=" 02. PNG "alt=" Wkiom1kzw3lhz84caaa56wqbtza207.png "/>
Note: In User Settings, set the Settings.xml file in the apache-maven-3.2.2/conf directory that you installed for yourself, and the Local repsitory directory will change as well.
2. Create a Java MAVEN project: (Create a Web project for subsequent replenishment)
A. Right-click in the package Explorer to create a new MAVEN project. (If right click does not exist, you can set it in window----Preferences--------------------------- Eclipse, as a familiar process, skilled skipped. )
650) this.width=650; "src=" Https://s1.51cto.com/wyfs02/M02/95/CE/wKioL1kZxS6iSosSAAAvAPNZiCo892.png "title=" Untitled. png "alt=" Wkiol1kzxs6isossaaavapnzico892.png "/>
b, check-to create a simple project (skip the Classic settings option), type GroupID, Artifactid, version content, and how to generate it, the Java project generates a jar package, and the Web project generates a war package.
650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M01/95/CE/wKiom1kZx0DAOhF9AABE3OAOSa8082.png "title=" 03. PNG "alt=" Wkiom1kzx0daohf9aabe3oaosa8082.png "/>
650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M01/95/CE/wKioL1kZx0GiNRpuAAA_Pyn7cAg927.png "title=" 04. PNG "alt=" Wkiol1kzx0ginrpuaaa_pyn7cag927.png "/>
C, the generated Java engineering maven JRE System Library is version j2se-1.5, if you want to change to version j2se-1.7, you need to make some changes in the settings.xml file. (In fact, the 1.5 version is not much of a problem, that is, generics on the diamond can also appear in the problem.) )
650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M00/95/CE/wKioL1kZyEezymZSAAAS9Cx20WA321.png "title=" 05. PNG "alt=" Wkiol1kzyeezymzsaaas9cx20wa321.png "/>
650) this.width=650; "src=" Https://s1.51cto.com/wyfs02/M00/95/CE/wKioL1kZyVGj0VXKAABaWOh8GEE848.png "title=" 06. PNG "alt=" Wkiol1kzyvgj0vxkaabawoh8gee848.png "/>
Note: This file is the file in the Conf directory of the MAVEN core program you installed, add the following to the Profiles tag
<profile>
<id>jdk-1.7</id>
<activation>
<activebydefault>true</activebydefault>
<jdk>1.7</jdk>
</activation>
<properties>
< Maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>
<maven.compiler.compilerversion>1.7</maven.compiler.compilerversion>
</properties>
</profile>
D. Re-create a Java MAVEN project after modification and find that the JRE System Library has been modified.
650) this.width=650; "src=" Https://s4.51cto.com/wyfs02/M02/95/CE/wKiom1kZym2SdWuiAAATGu2eCJY090.png "title=" 07. PNG "alt=" Wkiom1kzym2sdwuiaaatgu2ecjy090.png "/>
3. Common commands for using MAVEN engineering in Eclipse: (In fact, it is very simple, the mouse points to Pom.xml, right-click, Run as can be displayed.) )
650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M02/95/CE/wKiom1kZy-agdFBEAAIhLGxzrp8320.jpg "title=" New bitmap image. jpg "alt=" wkiom1kzy-agdfbeaaihlgxzrp8320.jpg "/>
Note: If you need to compile the main program for this MAVEN project, click the second maven build ... After that, enter compile in the goals and click Run.
650) this.width=650; "src=" Https://s2.51cto.com/wyfs02/M01/95/CE/wKioL1kZzVPRcqmHAAA0Ae0ETJw108.png "title=" 08. PNG "alt=" Wkiol1kzzvprcqmhaaa0ae0etjw108.png "/>
650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M01/95/CE/wKiom1kZzVTwRFjjAAAtirErFRU978.png "title=" 09. PNG "alt=" Wkiom1kzzvtwrfjjaaatirerfru978.png "/>
This article is from the "12392717" blog, please be sure to keep this source http://12402717.blog.51cto.com/12392717/1926064
Settings for Maven plugins in Eclipse and related usage issues with MAVEN engineering in eclipse