Starting JBoss with Gradle on Windows

Hi everybody,

we are trying to implement a local install/setup/deploy environment for our developers with JBoss. They should be able to call a task “:setupJBoss” which then downloads JBoss, starts it, does configurations and stops it afterwards.

So far we are doing good on the install and setup part, but currently we need to start and stop JBoss manually (calling standalone.bat for starting, using the jboss-cli.bat > shutdown to stop it)

The problem is:
If I use a ProcessBuilder to call standalone.bat, I cannot stop the instance with Gradle since it somehow is blocked. I tried to use an Exec task but cannot get Gradle to return from the call and let the server be.

Has anyone done something similar on windows? It doesn’t have to be JBoss because the problem is a general problem (starting a long-running batch in background and return to Gradle)

Any help is appreciated,

Thanks,
Stefan

The Cargo plugin provides this functionality via the tasks cargoStartLocal and cargoStopLocal. I’d give it a shot.