Successive run configurations in IntelliJ IDEA

IDE Tips
Reading time: 1 minute, 33 seconds

In my open source projects (e.g. my Cluecumber Maven Plugin for Cucumber reports), I usually keep all the code in GitHub monorepos. This way, multiple projects that belong together are easier to maintain because you only need to checkout one repository instead of many.

The setup I use is

Cluecumber

in which plugin-code contains the source code and example-project is a project that uses the latest version of the compiled plugin in an small test project.

My usual workflow was

  • make changes in the plugin code
  • run a Maven run configuration to build the plugin
  • run a Maven run configuration to run the example project with the fresh plugin

This was a little bit of overhead every time I wanted to see my changes in action (of course I also have a lot of unit tests during the build phase but still).

So I found out that it is quick and easy to change this so both configurations are executed in sequence without having to wait for one to complete and then manually triggering the next.

  1. Edit run configuration that is the last one you want to execute (in my case running the example project) and go to the General tab.

    General tab

  2. Scroll down to the Before launch section

    Before launch

  3. Click the + button and choose the type of configuration you want to run prior to this configuration (in my case Run Another Configuration).

    Choose configuration

  4. Choose the configuration from the newly opened list.

    Existing configurations

  5. The chosen configuration will be added to your existing configuration!

If everything is set up correctly, triggering the example-project run configuration now opens two tabs in IntelliJ - one for each confguration in the sequence. The bar below the configuration name shows which one is currently executed.

This way of running chained configurations turned out to be a huge time saver for me as I execute them many times during my development cycle.

Previous Post Next Post