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 File → Import 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 ...

Get Maven: The Definitive Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.