I am trying to get gradle to start a server on a different process. I have the following task, but it is not working, also this is not OS independent. Is there a way to execute something like this on a different process in a way that os OS independent?
But I get the following error when running: > Cannot cast object ‘[Ljava.lang.String;@33571678’ with class ‘[Ljava.lang.String;’ to class ‘java.lang.Iterable’ due to: groovy.lang.GroovyRuntimeException: Could not find matching constructor for: java.lang.Iterable(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String)
Ok I got it to work, but this didn’t solve my initial problem. The server is started but it is still in the same process, i.e. the server process stalls gradle while waiting for calls. Basically my script is stalled in my startServer task. I want it to start the server and perhaps delay the script a little (while the server starts) and continue to other tasks. Ans this is not happening.
It is a different process. Gradle is just blocking while the other process runs. If you want non blocking behaviour you’ll have to write your own task and use Java’s ProcessBuilder API. Gradle doesn’t have anything above this for async process management.