是否有可能调试外部ant任务?(Is it possible to debug an externa

2019-07-30 06:35发布

我有一个调用外部Ant任务Ant脚本:

    <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启动JVM上的Unix机器。 “在“Java”的任务Xdebug的”,但对外部任务...我不知道如何使用它 - 我读了几DOC其使用“jvmarg值=”。 谢谢!

Answer 1:

在运行Ant之前设置ANT_OPTS环境变量。 假设你使用的Bash shell:

对于Java 1.4:

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

对于Java 1.5和更高版本:

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

运行Ant脚本,然后连接到端口5005与调试器。



文章来源: Is it possible to debug an external ant task?
标签: java ant