May 26, 2021 Maven
Eclipse offers an excellent plug-in, m2eclipse, that enables Maven and Eclipse to integrate seamlessly.
Here are some of the features of m2eclipse:
Use any of the following links to install m2eclipse:
Eclipse | Url |
---|---|
Eclipse 3.5 (Gallileo) | Installing m2eclipse in Eclipse 3.5 (Gallileo) |
Eclipse 3.6 (Helios) | Installing m2eclipse in Eclipse 3.6 (Helios) |
The following examples can help you effectively leverage integrated Eclipse and Maven.
Now you can see the Maven project in Eclipse.
If you look at the properties of the consumerBanking project, you can see that Eclipse has added everything Maven relies on to its build path.
Well, let's use Eclipse's compilation capabilities to build this Maven project.
Maven starts building and you can see the output logs in Eclispe'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 on the app .java. S elect the Run As option. Select As Java App.
You'll see the following results:
Hello World!