You are previewing Maven: The Definitive Guide.

Maven: The Definitive Guide

Cover of Maven: The Definitive Guide by Sonatype Company Published by O'Reilly Media, Inc.
O'Reilly logo

Importing Maven Projects

m2eclipse provides three options for importing a Maven project into Eclipse, including:

  • Import an existing Maven project

  • Check out a Maven project from SCM

  • Materialize a Maven project

Figure 14-10 shows the wizard for importing projects with the options for Maven provided by m2eclipse.

Importing a Maven project

Figure 14-10. Importing a Maven project

The dialog in Figure 14-10 is displayed when you use the FileImport command in Eclipse and then filter the options by entering the word “maven” in the filter field. As noted earlier, three options are available for importing a Maven project into Eclipse, including: Maven Projects, Check out Maven Project from Subversion, and Materialize Maven Projects.

Importing a Maven project from Subversion is identical to creating a Maven project from Subversion, as discussed in the previous section, so discussion of it here would be redundant. Let’s move on now to review the other two options for importing a Maven project into Eclipse.

Importing a Maven Project

m2eclipse can import a Maven project with an existing pom.xml. By pointing at the directory where a Maven project is located, m2eclipse detects all the Maven POMs in the project and provides a hierarchical list of them as shown in Figure 14-11.

Importing a multimodule Maven project

Figure 14-11. Importing a multimodule Maven project

Figure 14-11 ...

The best content for your career. Discover unlimited learning on demand for around $1/day.