Integration of Maven and eclipse

Source: Internet
Author: User

Eclipse is currently the most popular Java, J2EE development environment, because it is open-source free, we will first talk about how to use Maven in eclipse, another commercial IDE, I think intellij idea, which is more user-friendly and functional than eclipse, is the current version of 8.1, which is also an IDE that I have always admired and used over the years, I will also introduce how to use it in idea, which is relatively simple.

InEclipseUseMaven
Using Maven in eclipse is implemented through the plug-in named m2e. before talking about how to use it, Let's briefly talk about the features of m2e:

  1. Check out a project from SCM
  2. Use predefined archetype to create a project
  3. Create a Maven Module
  4. Import Maven Project
  5. M2eclipse has the POM editor, so you do not need to manually edit the Pom.
  6. M2eclipse built-in search function for central Maven Repository
  7. The dependency tree function allows you to conveniently view dependencies between jar packages.

With these features, you can easily start developing your Maven project in eclipse Without tedious commands. Just click the wizard step by step.

InstallM2e 

In eclipse, select software updates from the Help menu. In the software updates and add-ons dialog box, click the available software button, and then click Add site to add the updated site URL: http://m2eclipse.sonatype.org/sites/m2e. After you add this URL, you will be able to add Maven integration, Maven optional components, and Maven project configurators to your project.

SlaveMaven ArchetypeCreateMavenProject 

Maven Archetype is a project template. The Maven repository contains many archetype types, from web applications to Message Components. With m2eclipse, it is very easy to use Maven archetype. To create a Maven project using mavenarchetype, select File> New> project... And then input Maven in the filter field. Select a new Maven project and click Next. The next screen provides an interface for you to select the mavenarchetype for the new project.

Search for dependencies and components

Quick Searching and locating of Dependencies from the maven repository can greatly save time. With m2eclipse, you no longer need to find a central repository for components of a version. If you need to add a component to the maven project, right-click the project and select Add dependency under the maven menu. Then, you will see the dialog box as shown in. Simply entering groupid and artifactid will allow m2eclipse to search for the Nexus index of a Maven repository and display matched components. Quick component Locating means that you no longer need to spend countless times in the maven repository to find a specific dependent component.

Analysis dependency tree 

M2eclipse provides some interesting functions for you to analyze and draw charts on Project dependencies. You can click the project Pom. XML to load the POM editor. If you open a project with many dependencies, you can click the dependency tree Tab Of the POM editor and see the dependency display.

If you want to view dependencies in graphs, click the dependency graph tab to view the project dependency graph. Click a node in the figure to highlight the node and emphasize the relationship between the component and other components in the project dependency.

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.