'How to add a timeout to gradlew command?

I'm executing a .war file that i developed in Java for an Apache Tomcat server. I'm executing gradleW command with these commands:

Windows: "cmd /c gradlew.bat assembleRelease --info"

OS X & Linux: "./gradlew assembleRelease --info";

The problem is that I want to add a timeout to gradlew and I don't know how to achieve it.

It is possible?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source