0

I have to create custom task in gradle to run 3 spring boot apps, but first 'dependsOn' block other commands from my task and only one app starts.

task startApps(type: Exec) 
{
    dependsOn 'modules::module_1::bootRun'
    dependsOn 'modules::module_2::bootRun'
    dependsOn 'modules::module_3::bootRun'
}

Anyone know how to do this ? Help me ;)

1 Answers1

0

Your task is running on a single thread. To get all three apps to run simultaneously you'll need to run them asynchronously in parallel. This answer explains how to do it programmatically using a ProcessBuilder. Another option if you have a multi-project build is to tell Gradle to run in parallel via the --parallel flag.