在gradle中调试jetty守护进程 [英] Debugging jetty daemon process in gradle
问题描述
-Xdebug -Xrunjdwp:transport = dt_socket,address = 12233,server = y,suspend = n
之类的东西,然后连接到gradle进程本身。但是,如果您使用daemon = true运行JettyRun任务,则不起作用。一个这样的任务的例子:
pre $ task jettyRunDaemon(type:JettyRun){
contextPath ='/'
classpath = sourceSets.test.runtimeClasspath
webAppSourceDirectory = file('src / test / webapp')
daemon = true
}
我尝试了一些其他的东西,比如用类似的方法设置 org.gradle.jvmargs
以上,无济于事。我怎么能得到发送到守护进程的调试参数?
我会给 org.gradle .jvmargs
另一个镜头。尝试将以下内容放入 gradle.properties
文件中:
org。 gradle.jvmargs = -XX:MaxPermSize = 256M -Xdebug -Xrunjdwp:transport = dt_socket,server = y,suspend = n,address = 4001
我在gradle 1.8中使用了这个功能,我可以附加并逐步完成代码。
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?
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.
这篇关于在gradle中调试jetty守护进程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!