I believe the cause of the problem is that Jenkins is running the build without (or with a limited) standard input. The runPlayBinary runs until an EOF character is read from the standard input. Since it can’t read from standard input or it reads an EOF character right away, it stops the server soon after it is started.
This actually makes sense. Jenkins is used mostly to automate tasks, and automated tasks in general should not expect user input. So I would suggest rethinking how you do what you’re trying to do.
One solution would be to have a Jenkins task that never ends (you’d have to manually stop it to stop the server). I’m not sure how to do this with Gradle besides changing the Gradle source code to not expect an EOF character. While easy, this could probably lead to unforeseen problems.
Another solution would be to have Jenkins build it (optionally publish it somewhere) and have a separate step to deploy it.
The easiest way to deploy it would be to run the runPlayBinary task manually when you want to run the server. I don’t know what is the proper way to deploy it, but I think it could be close to deploying it manually using activator instead of Gradle. See here about deploying Play applications.
What I would do in your case is use a Docker container. I don’t know how this might suit your needs, but I would keep the build inside Jenkins, then at the end of the build copy the repository to a Docker container, and start it in there.
There’s probably a better way to deploy (something similar to creating a distribution of the application), but I’m afraid I’m still learning about Play
Anyway, I hope this helps a little.