วันเสาร์ที่ 3 มกราคม พ.ศ. 2552

Other ways to run Maven on Eclipe.

M2eclipse is excellent Maven tool for Eclipse.
I always use hotkey Shift + Alt + X M to run the last maven goals of Maven Build projects.
example First time you run "compile goal" of MyProject. Next time you want to run with other goals. If you use this hotkey, It will run "compile goal" again. You must move a mouse, right click on project, then select Run as Maven builds ... and key the new goal that you want. It is inconvenient.

Today I read Eclipse integration with Grails. In the step Adding domain classes etc, It shows the way to use External Tools to run grails command. It can adapt to run maven goals.
1 Run -> External tools -> External tools configuration ... .
2 Select Program and new launch configuration.
3 Enter a name of "Maven".
4 Browse file system for the location of mvn command that you have installed.
5 Set the working directory to "${project_loc}".
6 Set the arguments as "${string_prompt}".
7 Under the "Refresh" tab, set to refresh the "project containing the selected resource" upon completion.
8 Under the "Common" tab, tick "Display in favorites menu".
9 I set hotkey Shift + Alt + X S to Runs the last launched external Tool.

Every time you use thes hotkey, Eclipe will always ask you what is the goals you need to run.
You can type any maven goals.

ไม่มีความคิดเห็น:

แสดงความคิดเห็น