1. Install the plugin in Eclipse M2eclipse
(if there is no plug-in in eclipse, you need to install it manually, if the plugin already exists in eclipse, you do not need to install it)
Under the Help menu in Eclipse, click Instance Newsoftware, the window will pop up, click Add, enter
Name:m2e
Location:http://download.eclipse.org/technology/m2e/releases
Follow the steps to install the plugin
2. Download maven and configure
Go to the MAVEN website download page: http://maven.apache.org/download.cgi download maven Project
Enter the Conf subdirectory under the MAVEN root directory to open settings.xml for configuration changes
(1) Modify the default local warehouse location <localRepository>d:/.m2/repository</localRepository> #将默认的本地仓库的位置修改到d:/.m2/ Repository
(2) Modify the default central warehouse image
</Mirrors> <Mirror> <ID>Aliyun</ID> <name>Aliyun</name> <URL>http://maven.aliyun.com/nexus/content/groups/public/</URL> <mirrorof>Central</mirrorof> </Mirror> </Mirrors> <Profiles> < Profile> <ID>Nexus</ID> <repositories> <Repository> <ID>Central</ID> <URL>Http://repo.maven.apache.org/maven2</URL> <Snapshots> <enabled>False</enabled> </Snapshots> </Repository> <Repository> <ID>Ansj-repo</ID> <name>ANSJ Repository</name> <URL>http://maven.nlpcn.org/</URL> <Snapshots> <enabled>False</enabled> </Snapshots> </Repository> </repositories> </ Profile> </Profiles> <Activeprofiles> <Activeprofile>Nexus</Activeprofile> </Activeprofiles>
Save the changes and copy the settings.xml file to the D:/.M2 directory
3. Set up the MAVEN program associated with the plugin
Click Preferences under the Window menu in eclipse to find maven:
Expand the Maven node, select the installations sub-node, click the Add button, select the root directory of the MAVEN project you want to add
4. Set up your own local warehouse
Open Maven child node user Setting, here to modify the Setting.xml file under the Custom warehouse location, click Browse ...
5. New MAVEN Project
Select WebApp Project
The MAVEN project is new and complete.
This article refers to:
Build a Maven project with eclipse
Using Maven in Eclipse