There seems to be extensive documentation for debugging Play applications with IntelliJ IDEA, but they all assume that Play is built with SBT.
Debugging with Gradle should be as easy as:
GRADLE_OPTS="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=9999" gradlew --no-daemon :runPlayBinary
The problem I'm having is: the breakpoint is never hit, processing continues as normal. Technologies: Play 2.3.X, IDEA 14.1, Gradle 2.8, Scala 2.10
I must be missing something, what is it?
Play 2.7, Java 8, Gradle combo required the following:
run it with: gradle runPlay -Ddebug=true
play {
injectedRoutesGenerator = true
platform {
playVersion = playV
scalaVersion = scalaV
javaVersion = javaV
}
if (System.getProperty("debug")) {
def runPlayTask = tasks.findByName('runPlay')
runPlayTask.forkOptions.jvmArgs = ['-Xdebug', '-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005']
}
}```
Building on joao's answer, you can create a new task and use your remote configuration to connect to it:
task debugPlayBinary {
doLast {
def runPlayTask = tasks.findByName('runPlayBinary')
runPlayTask.forkOptions.jvmArgs = ['-Xdebug', '-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005']
runPlayTask.run()
}
}
This allows runPlayBinary
to remain untouched.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With