Search code examples
eclipsemavenm2eclipse

How to add profiles to default maven goals in Eclipse?


I am using Maven inside Eclipse to build and deploy code.

When choosing {Context Menu} > Run As, several Maven goals appear as follows:

Eclipse Run As Context Menu

I understand that if I want to create a custom build configuration, I would click "Run Configurations..." to create a custom configuration.

However, there seems to be no way to modify the configurations that appear conveniently on the menu. For instance, you can't add a profile to #7 "Maven install". The result is tedious, because you have click about 5 times to launch the build.

Is there any way to add profiles or additional goals to #7 "Maven install" build or add custom configurations to the context menu?

Is there a way to launch a specific build configuration with a keyboard combination?

I have tried IntelliJ and NetBeans and the Maven integration in all of them seems confusing trying to differentiate between basic Maven goals and the more realistic custom combination of goals and profiles.


Solution

    1. Select "Maven build..." from the menu and create the configuration

    Create configuration

    1. Add it to the favourites for later use / launch the build

    Add it to favourites for later use