Creating Maven Projects in MyEclipse

This tutorial describes how to create a web project that integrates with Maven. A simple checkbox creates a Maven-enabled project. In this tutorial, you will learn how to:

  • Create a new Maven project
  • Import an existing Maven project

Duration Time: 10 Minutes

Start Tutorial Now

Don't have MyEclipse? Download Now

1. Creating a Maven Project

  1. Select File>New, and select the type of project you want to create. You can add Maven support to Web, EJB, EAR, and conventional Java projects.
  2. Fill in the fields on the New Project window, select the Add Maven support checkbox, and click Next until you reach the Artifact page.
    Maven project - Add Maven Support Checkbox
    Adding Maven support
  3. Enter the Group ID and Artifact ID. These follow typical package and project naming conventions.

    The project structure defaults to a standard MyEclipse project structure. You can choose to use the Maven project structure instead.
    Maven project support
    Adding group and artifact IDs
  4. Click Next to add additional libraries, or Finish to accept default libraries and create the project.

    The Project Explorer displays all maven dependencies, and in the pom.xml file the dependencies are outlined as XML.

    Maven project POM
    Dependencies in the POM file

    You can add technology facets to the Maven project in the same way that you add facets to other MyEclipse projects.

    2. Importing a Maven Project

    You can import an existing Maven project by selecting the root folder in which the project files reside.

    1. Select File>Import, expand Maven4MyEclipse, select Existing Maven Projects, and click Next.
      Import Maven project
      Importing an existing maven project
    2. In the Root Directory field, browse for the Maven project root folder. The projects contained in the root appear in the Projects list.
      Import Maven project
      Specifying the project root and selecting projects to import
    3. Select all projects, or select only the ones you want to import, and click Finish.