Configure and use Maven in Eclipse

Source: Internet
Author: User

Configure and use Maven in Eclipse

Build a Maven development environment under Eclipse.

Now we need to use Eclipse to develop Maven projects. We need to configure Maven in a simple way.

1. Download the Maven installation package.

2. If you directly use the Apache image library, you do not need to modify the configuration, and Maven can also be used normally. But foreign websites sometimes because of some firewall reasons sometimes slow access, you can add the Ali Image Library, in the apache-maven-3.5.2 \ conf \ settings. add an image library configuration under the mirrors label in the xml file.

<Mirrors>
<! -- Add configurations of Alibaba Cloud backup storage in China -->
<Mirror>
<Id> aliyun </id>
<Name> aliyun Maven </name>
<MirrorOf> * </mirrorOf>
<Url> http://maven.aliyun.com/nexus/content/groups/public/ </url>
</Mirror>
</Mirrors>

3. Configure Eclipse. Now, the new version of Eclipse is integrated with the Maven plug-in. You don't need to install it manually. Configure the Maven configuration file directly in preferences and select your settings configuration file, click Update Settings to Update the configuration.

4. If you have modified the image library, you can check whether Maven Repositories has taken effect.

You can re-index to improve search efficiency.

5. Create a New Maven Project

You can skip this step.

Enter the following information based on the actual situation, and click Finish to create the project.

6. Now the project has an error message because there is no web. xml file. Right-click to generate one automatically.

Next, add the dependent jar package. You can directly edit pom. xml or operate it using a visual tool. The effect is the same.

After saving the package, the configuration dependency package will be downloaded from the Maven library. You can view it here.

To update the dependency package later, use this menu.

At this point, the building process of a Maven project is over, and the rest of the work is for the project itself.

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.