Using Maven in Eclipse

Source: Internet
Author: User
Tags aliyun

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.