Debugging jetty daemon process in gradle

送分小仙女□ 提交于 2019-12-13 04:44:17

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/18729998/debugging-jetty-daemon-process-in-gradle

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!