Maven 2 Repository
Eclipse needs to know the path to the local Maven repository. Therefore the classpath variable m2_repo have to be set. Execute the following command:
Mvn-declipse.workspace=<path-to-eclipse-workspace> Eclipse:add-maven-repo
Restart your Eclipse IDE (if you already has it open) for the change to take effect.
You can also define a new classpath variable inside eclipse:from the menu bar, select Window > Preferences. Select the Java > Build Path > Classpath Variables page.
Simple Project
If you had a simple Java project which are made up of only one module, using the eclipse is very simple. To generate the Eclipse project files from your POM you execute the following command:
MVN Eclipse:eclipse
If you have a created or checked out of the project with Eclipse, you are only having to refresh the project in your workspace. Otherwise you has to import the project into your Eclipse workspace (from the menu bar, select File >import >existi ng Projects into Workspace). In the latter case the project (directory) should not being located in your workspace, because eclipse might come into Troubl E, especially if want to use eclipse as the SCM client.
Http://maven.apache.org/guides/mini/guide-ide-eclipse.html#Maven_2_repository
PS: Can be re-executed under the project directory after updating the POM
MVN Eclipse:eclipse
To regenerate the Eclipse project description file, and then restart Eclipse.