Depressio
Depressio

Reputation: 1379

Debugging jetty daemon process in gradle

Using a JettyRun task, it's easy to debug. You can merely add something like -Xdebug -Xrunjdwp:transport=dt_socket,address=12233,server=y,suspend=n to your GRADLE_OPTS and hook up to the gradle process itself.

However, if you run a JettyRun task with daemon = true, this doesn't work. Example of one such task:

task jettyRunDaemon (type: JettyRun) {
    contextPath = '/'
    classpath = sourceSets.test.runtimeClasspath
    webAppSourceDirectory = file('src/test/webapp')
    daemon = true
}

I've tried some other things, such as setting the org.gradle.jvmargs with a similar thing as above, to no avail. How can I get the debug args sent into the daemon process?

Upvotes: 0

Views: 965

Answers (1)

Courtney Faulkner
Courtney Faulkner

Reputation: 2080

I would give org.gradle.jvmargs another shot. Try putting the following into a gradle.properties file:

org.gradle.jvmargs=-XX:MaxPermSize=256M -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=4001

I'm using this with gradle 1.8 and I'm able to attach and step through code.

Upvotes: 1

Related Questions