Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to run multiple applications in IntelliJ with just one press of a button?

Is there a way to run multiple applications with just one press of a button?

Say, I have AppA, AppB, and AppC (they are all in java). Is there a way that they could run all 3 in some order with just one button press?

It's kinda tedious hitting the "run" button for like 10 applications. I'm assuming a script or maybe a plugin?

like image 382
joannaSmith12 Avatar asked Apr 22 '13 12:04

joannaSmith12


People also ask

How do I enable parallel run in IntelliJ?

Allow parallel runSelect Run | Edit Configurations from the main menu or Edit Configurations from the run/debug configuration selector on the toolbar. Choose your configuration from the list. Select the Allow parallel run checkbox and click OK.

Can I open multiple instances of IntelliJ?

You can switch between opened projects using Ctrl+Alt+] (next project) and Ctrl+Alt+[ (previous project). This opens new window of same instance of Intellij.


2 Answers

I think this has been possible since version 15. You simply create a Run/Debug Configuration of type 'Compound', and select the configurations you want to run, so:

  1. Ensure you have previously set up run configurations for the various applications (or other run configurations) that you want to run.
  2. Click on the 'Run' menu
  3. Click 'Edit Configurations'
  4. Click the green '+' icon (top-left of the window)
  5. Click 'Compound'
  6. In the right-hand pane, enter a meaningful name for your group, then click the green '+' icon (the one in the right-hand pane, not the top-left of the window)
  7. Select one of the run configurations
  8. Repeat 5 and 6 for all the configurations you want to run in a single click
  9. Hit OK
  10. Select your newly-created compound configuration in the drop-down in the menu bar
  11. Hit the run button (note that you don't appear to be able start all the applications in debug mode, if you want to do that, you'll need to do so individually)
  12. Watch all your applications start, one-by-one. Revel in your newly discovered free time

2 drawbacks:

  1. As CashIsClay points out below, you can't explicitly change the order that your configurations run in; they run in alphabetical order. I'm not sure that this is a big restriction though, I'd want my applications to be able to start in any order for resilience in production environments. Of course, a non-terrible workaround would be to name your run configurations something like: '1. Foo'; '2. Bar', if it's essential for Foo to run before Bar starts.
  2. You can only start in 'run' mode, not 'debug'.

Other answers have mentioned the Multirun plugin, which may offer more functionality than IntelliJ's native options. I haven't used it, but it might be worth looking at.

like image 199
DaveyDaveDave Avatar answered Oct 08 '22 06:10

DaveyDaveDave


There seems to be a Multirun plugin for IDEA:

Allows to run multiple run configurations at once: group multiple run configurations and start them in a single click. Not only application and test run configurations can be grouped, but other Multirun configurations can be organized into single run configuration.

like image 24
user1338062 Avatar answered Oct 08 '22 04:10

user1338062