Creating Maven Projects
This tutorial describes how to create a web project that integrates with Maven. A simple checkbox creates a Maven-enabled project. You will also learn how to import an existing Maven project.
Maven support is available in MyEclipse.
1. Creating a Maven Project
- 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.
- Name the project and complete each field making sure to select the Add Maven support checkbox. Click Next until you reach the Maven Project Support page.
Adding Maven support - In the Artifact section, 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.
Adding group and artifact IDs - 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.
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.
- Select File>Import, expand Maven, select Existing Maven Projects, and click Next.
Importing an existing maven project - In the Root Directory field, browse for the Maven project root folder. The projects contained in the root appear in the Projects list.
Specifying the project root and selecting projects to import - Select all projects, or select only the ones you want to import, and click Finish.