Eclipse: launch Maven command from eclipse

If you’re using eclipse for your developments and Maven for your building process, you may want to launch Maven commands directely from eclipse without going back to the command line. That is my case too, and here are the steps that may help you doing that:

  1. Right click on the project in eclipse interface
  2. Click on Run As
  3. If available, click on Maven build
  4. In the Main panel there is a field named Goals, fill there the goals you want to execute (compile, package, etc.)
  5. Hit Run

If the option Maven build is not available under the menu Run as, don’t worry ! Just click on Run configurations, then right click on Maven build (inside the panel on the left) and choose New. In the Main panel (on the right), fill the Base directory (for example: ${workspace_loc:/YOUR_PROJECT_NAME}), then go to the step n°4 in the step list described before.

Enjoy ! =)