Maven Eclipse
Eclipse provides a very good plugin **m2eclipse **that integrates Maven with Eclipse.
The latest Eclipse comes with Maven built in; open Windows->Preferences, and if the following screen appears:

Some features of m2eclipse are listed below:
- Maven goal files can be run in the Eclipse environment.
- You can use its built-in console to view Maven command output directly in Eclipse.
- You can update Maven dependencies in the IDE.
- You can use Eclipse to carry out Maven project builds.
- Eclipse implements automated dependency management based on Maven's pom.xml.
- It resolves dependencies between Maven and the Eclipse workspace without needing to install them into the local Maven repository (the dependent projects need to be in the same workspace).
- It can automatically download required dependencies and source code from remote Maven repositories.
- It provides wizards for creating new Maven projects, pom.xml files, and enabling Maven support on existing projects.
- It provides fast search of dependencies in remote Maven repositories.
Importing a Maven Project in Eclipse
- Open Eclipse
- Choice File > Import > option
-
Select the Maven Projects option. Click the Next button.

- Select the project path, i.e., the storage path when a project was created with Maven. Suppose we created a project: consumerBanking. Via Maven Building a Java Project see how to create a project with Maven.
-
Click the Finish button.

Now you can see the Maven project in Eclipse.

Look at the properties of the consumerBanking project; you can see that Eclipse has added all Maven dependencies to its build path.

Now let's use Eclipse's compile function to build this Maven project.
- Right-click to open the context menu of the consumerBanking project
- Select the Run option
- Then select the maven package option
Maven starts building the project; you can see the output log in Eclipse's console.
[INFO] Scanning for projects...
[INFO] -------------------------------------------------------------------
[INFO] Building consumerBanking
[INFO]
[INFO] Id: com.companyname.bank:consumerBanking:jar:1.0-SNAPSHOT
[INFO] task-segment: [package]
[INFO] -------------------------------------------------------------------
[INFO] [resources:resources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:compile]
[INFO] Nothing to compile - all classes are up to date
[INFO] [resources:testResources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:testCompile]
[INFO] Nothing to compile - all classes are up to date
[INFO] [surefire:test]
[INFO] Surefire report directory:
C:\MVN\consumerBanking\target\surefire-reports
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running com.companyname.bank.AppTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.047 sec
Results :
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
[INFO] [jar:jar]
[INFO] -------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] -------------------------------------------------------------------
[INFO] Total time: 1 second
[INFO] Finished at: Thu Jul 12 18:18:24 IST 2012
[INFO] Final Memory: 2M/15M
[INFO] -------------------------------------------------------------------

Now, right-click App.java, select Run As option. Select As Java App
you will see the following result:
Hello World!