Friday, August 2, 2013

Running maven project through eclipse

As a build engineer, I got first exposed to maven through command line interface. Since Java development is done better through IDE, it is good to run maven projects from eclipse. This blog explains step by step guide to run a maven project from eclipse.

Note: I'm using Eclipse Juno.

1) Install m2eclipse plugin
          Open Eclipse IDE ->  Help -> Eclipse Marketplace -> Find -> Maven
          Select either
             Maven Integration for Eclipse by Eclipse.org  or
             Maven Integration for Eclipse WTP by by Eclipse.org
           and click 'Install' and follow the links.

      Verification: Eclipse IDE -> Window -> Preferences -> You should notice maven in left panel

2) Import maven project in Eclipse
    Eclipse IDE -> File -> Import -> Maven -> Existing Projects -> Next
    'Root Directory' -> Browse -> Select your maven project and 'Finish'

3) Building maven project in Eclipse
    Eclipse IDE -> Right click on your project -> Run as ->  Maven clean / Maven install

No comments:

Post a Comment