The approach I use in this case is to create launch configurations for the goals I want ( mvn package in your case), and then use the key bindings to access these config starts:
- Bind Maven Create your desired key
- Note: by default it is equal to shift - alt - X , M
- Create a Maven Run configuration for your desired goals, for example
mvn package- Select the project, choose Run> Run Configurations.
- Select the current maven launch configuration for your project (under Maven Build> yourProjectName)
- Click the copy button in the upper left corner to copy the run configuration.
- in the names section, specify a meaningful name, for example, "yourProject - package",
[optional, rename the original configuration to something like "yourProject - install"] - In the Goals section, enter your desired goals, such as a “clean package”
- Select Apply, then Close
- Use the Maven Build key binding, then the arrow keys to select a suitable target
- Now, when you click on the "Maven Build" link, you will be offered a window to select the desired launch configuration. This window appears only when you have more than one maven launch configuration! From there, press ENTER and select the target of your package!
- pressing enter will select the first maven configuration
- use the arrow keys to select other configurations
- specify your configurations so that the one you use most is at the top
Now, to execute the mvn package in your project, click:
shift - alt - X , M
enter
To run mvn clean install -DskipTests in your project, click:
shift - alt - X , M
down
down
enter
Hope this helps someone ...
gMale
source share