CALL FOR ACTION: If you like this feature please vote up on 470138.
This kinda answers this SO question.
Recent updates:
> mvn help:describe -Dcmd=deploy
would do the trick. But alas it does not. It only lists the statically associated goals as per the static lifecycle definition - and not the actual goals you may configured in the pom's plugin configuration section. IMO this is simply - unimplemented yet useful functionality of Maven.
In this blog entry I talked about listing phases and actual associated goals of a maven lifecycle of a maven pom. In it I talked about an Eclipse plugin based on m2e code. I have improved it further. Now you can show the phases and goals in a checked tree dialog using the Project > Phases and Goals command.
You can run the selected phases or goals using the Launch selected goals command. When a phase is selected all goals associated with that phase are run. In Single Selection Mode the goals simply get added to the set in the order in which they were selected. This allows execution of orders in any order you want.
Maven 3.3.1 or greater is required to run the goals.
NOTE: If you install external Maven 3.3.1+ and try to use it as the installed Maven using Window > Preferences > Maven > Installations you may see an error during the build:
-Dmaven.multiModuleProjectDirectory system property is not set...
To fix that configure the property in your JDK/JRE installation using Window > Preferences > Java > Installed JREs > select default JDK/JRE > edit.
- See more at: http://marketplace.eclipse.org/content/phases-and-goals
You can print the listing to the Maven Console using the Log All command.
or use:
1129 installs from Eclipse Marketplace so far.
Recent updates:
- Save named configurations
- The dialog is now mode less, thus allowing multiple invocations. If there is are multiple Maven projects in the workspace, a selector to invoke Phases and Goals on selected other project is shown.
- Run goals in selection order instead of build agenda order. Using this mode you can run goals in any order. An astute reader may note that you can also type goals in text area before running them. This allows you to even run goals not associated with any phase.
- Selecting a phase selects the associated goals
- Expand all Phases
- Expand all/Collapse all
- If there is only one Maven project in the workspace, that is always selected.
- Added a simple Maven Build Spy. It shows the success or failure of the goals, the timing and the exception message as a tooltip for failed goals.
You can even use the spy in your maven builds by:
- Downloading the Maven Build Spy jar.
- And then passing the following parameter to your mvn build like so:
> mvn -Dmaven.ext.class.path=path-to/mavenbuildspy.jar ....
When you run a phase, Maven runs all the preceding phases as per the lifecycle definition. However, sometimes I only want to run a selective subset of phases. The only way to do that is to actually run the goals associated with those phases explicitly. However how to get that list of goals? One would think that running:> mvn help:describe -Dcmd=deploy
would do the trick. But alas it does not. It only lists the statically associated goals as per the static lifecycle definition - and not the actual goals you may configured in the pom's plugin configuration section. IMO this is simply - unimplemented yet useful functionality of Maven.
In this blog entry I talked about listing phases and actual associated goals of a maven lifecycle of a maven pom. In it I talked about an Eclipse plugin based on m2e code. I have improved it further. Now you can show the phases and goals in a checked tree dialog using the Project > Phases and Goals command.
You can run the selected phases or goals using the Launch selected goals command. When a phase is selected all goals associated with that phase are run. In Single Selection Mode the goals simply get added to the set in the order in which they were selected. This allows execution of orders in any order you want.
Maven 3.3.1 or greater is required to run the goals.
NOTE: If you install external Maven 3.3.1+ and try to use it as the installed Maven using Window > Preferences > Maven > Installations you may see an error during the build:
-Dmaven.multiModuleProjectDirectory system property is not set...
To fix that configure the property in your JDK/JRE installation using Window > Preferences > Java > Installed JREs > select default JDK/JRE > edit.
- See more at: http://marketplace.eclipse.org/content/phases-and-goals
You can print the listing to the Maven Console using the Log All command.
To use
- Make sure you have m2e plugins installed into your Eclipse.
- Then install the fragement from this update site URL:
https://cdn.rawgit.com/sandipchitale/m2e-phasesandgoals/1.0.28/org.eclipse.m2e.core.ui.phasesandgoals.updatesite/site.xml
- Restart Eclipse
- Select a maven project node and invoke Project > Show Phases and Goals command. You will see the output like above in the Maven Console. If a resource from Maven Project is not selected you are prompted to select on.
Github
https://github.com/sandipchitale/m2e-phasesandgoals
BTW This is implemented as a fragment for https://github.com/eclipse/m2e-core/tree/master/org.eclipse.m2e.core.ui
Enjoy!