How to Create a Simple Project in m2eclipse


February 17, 2010 By Tim O'Brien

One of the most compelling features of m2eclipse is the ability to quickly generate new Maven projects using the New Maven project wizard. This post and the associated video demonstrate the steps to create a simple Maven project using the New Maven project wizard to select the Maven Quickstart archetype.

To create a simple project using the New Maven project wizard:

  1. Select File > New Project. This should display the “New Project” dialog.
  2. In the “New Project” Dialog, expand the Maven folder, and select “Maven Project”.
  3. Click Next. The next screen provides options for customizing the location of your new Maven project. If you are storing the new project in your workspace, you can supply the directory on this page.
  4. Click Next. The next screen lists all of the available Maven Archetypes, select the Maven Quickstart Archetype which should be listed under the group id “org.apache.maven.archetypes”.
  5. Click Next. On the next screen, supply a Group Id, Artifact Id, and Version for your new project.
  6. Click Finish and m2eclipse will use the Maven Quickstart Archetype to generate a new Maven project in your Eclipse workspace.

Note about 0.9.8 Workspace Incompatibility: If you are using m2eclipse 0.10.0 with a workspace that contains projects created under m2eclipse 0.9.8, you must remove the workspaceState.ser file. The workspaceState.ser file is located within the workspace directory in $workspacedir/.metadata/.plugins/org.maven.ide.eclipse/workspaceState.ser. If you remove this file, m2eclipse 0.10.0 will regenerate it as needed.