gradle / gradle/playframework

Server stops immediately when runPlay is run from another tasks

Open
#158 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
47
Forks
41
PR merge metrics
No merged PRs in 30d

Description

Gradle 6.6.1. Version 0.10

Not sure what's going on here. The application runs fine from the distribution tar and if runPlay is called directly. I can see that the server starts and that port 8080 is bound but then `PlayWorkerServer::stop()` is called.

```
// TOP project
def jvmArgs = /* ... */
def createSampleAppTarget = { name, target ->
tasks.create(name: name, type: GradleBuild, dependsOn: shadowJar) {
description = "Run $target with instrumentation"
group = 'application'

startParameter = startParameter.newInstance()
startParameter.projectProperties = [
jvmArgs : "-javaagent:$shadowJar.archivePath $jvmArgs",
debugJvm : project.hasProperty('debugJvm') ? project.debugJvm : 'false',
]
tasks = [target]
}
}

createSampleAppTarget 'runInstrumentedPlayApp', ':samplePlayApp:runPlay'
```

```
// SUBPROJECT
runPlay {
httpPort = 8080

// TODO: possible to change executable? doesn't look like so
def jvmArgs = []
if (project.hasProperty('jvmArgs')) {
jvmArgs += (project.jvmArgs.split(/\s+/) as List)
}

if (project.hasProperty('debugJvm') && project.debugJvm == 'true') {
jvmArgs += ['-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=0.0.0.0:5005']
}
forkOptions.jvmArgs = jvmArgs
}
```

I can't reproduce this is the task that calls the `runPlay` task is in the same project.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.