0

I'm working on an Eclipse microprofile application, and I would like to create a run configuration that executes these 3 commands in order:

mvn clean package
mvn package
java -jar target/myApp.jar

How can I do this? I have this:

enter image description here

Where and how can I set what I want?

Usr
  • 2,628
  • 10
  • 51
  • 91

2 Answers2

0

I'm not sure that from the m2 plugin, you be able to accomplish the task of running multiple maven goals within a single run configuration.

However, as a workaround, you can add a batch file within your maven project directory with the following entries

call cls
%cd%
call mvn clean install
call java -jar target/myApp.jar

Running the above script can help you with running multiple maven commands in a synchronized manner.

Haagenti
  • 5,602
  • 1
  • 9
  • 17
0

First, you have to create a Maven Build launch configuration for each of the first two commands. The third command (java -jar target/myApp.jar) can be done with an External Tools Configuration of the type Program.

Then, create a Launch Group with all these three launch configurations.

howlger
  • 31,050
  • 11
  • 59
  • 99