Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 642
jedatu Avatar asked Nov 06 '13 19:11

jedatu


People also ask

Where are profiles configured in Maven?

Profiles are specified in pom. xml file using its activeProfiles/profiles elements and are triggered in variety of ways.

How do I add a goal in Maven?

From the main menu, select Run | Edit Configurations to open the run/debug configuration for your project. In the list that opens, select Run Maven Goal. In the Select Maven Goal dialog, specify a project and a goal that you want to execute before launching the project. Click OK.


1 Answers

  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

like image 185
Morfic Avatar answered Oct 01 '22 17:10

Morfic