ForgeGradle icon indicating copy to clipboard operation
ForgeGradle copied to clipboard

Gradle does not pass console commands to server

Open mcenderdragon opened this issue 5 years ago • 1 comments

When I start a server using ./gradlew runServer the server starts but writing stop into the console does not work and is not passed to the server. Using --no-daemon does not help. If the server is started from IntelliJ or eclipse it does work and the commands are passed to the server.

gigaherz found this: image

Unfortunetly the runServer task is ~~not a normal task~~ generated to late, so even using

project.afterEvaluate {
    tasks.runServer.standardInput = System.in
}

doesnt work.

mcenderdragon avatar Apr 03 '20 12:04 mcenderdragon

No idea if this is still relevant for you after 2 years, but I've found a working alternative to the afterEvaluate snippet you posted:

tasks.withType(Task) {
    if (it.name == "runServer") {
        it.standardInput = System.in
    }
}

malte0811 avatar Jun 11 '22 10:06 malte0811