是否可以调试外部蚂蚁任务? [英] Is it possible to debug an external ant task?

查看:29
本文介绍了是否可以调试外部蚂蚁任务?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个调用外部蚂蚁任务的蚂蚁脚本:

I have an ant script which calls an external ant task:

    <taskdef name="runStoriesAsEmbeddables" classname="org.jbehave.ant.RunStoriesAsEmbeddables"         
    classpathref="project.classpath" />

     <runStoriesAsEmbeddables includes="**/Ant*Stories.java" ignoreFailureInStories="true" 
     ignoreFailureInView="false" 
     systemProperties="story.path=.,qr.host=*,qr.port=*" generateViewAfterStories="true" />

我想使用 -Xdebug 在 unix 机器上启动 JVM.我阅读了几个在java"任务中使用jvmarg value="-Xdebug"的文档,但对于外部任务......我不知道如何使用它.谢谢!

And I want to use -Xdebug to launch JVM on an unix box. I read several doc which using "jvmarg value="-Xdebug"" in "java" task but for external task...I don't know how to use it. Thanks!

推荐答案

在运行 Ant 之前设置 ANT_OPTS 环境变量.假设您使用 Bash shell:

Set the ANT_OPTS environment variable before running Ant. Assuming you use the Bash shell:

对于 Java 1.4:

For Java 1.4:

export ANT_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,address=5005,server=y,suspend=y

对于 Java 1.5 及更高版本:

For Java 1.5 and later:

export ANT_OPTS=-agentlib:jdwp=transport=dt_socket,address=5005,server=y,suspend=y

运行您的 Ant 脚本,然后使用您的调试器连接到端口 5005.

Run your Ant script and then attach to port 5005 with your debugger.

这篇关于是否可以调试外部蚂蚁任务?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆