我试图使用以下Ant任务干净 目录(无增量编译)汇编从不同的包超过100个Java类:Ant的<javac>任务抛出StackOverflowException
<target name="-main-src-depend">
<depend srcdir="${src.dir}"
destdir="${bin.dir}"
cache="${cache.dir}"
closure="true"/>
</target>
<target name="compile" depends="-main-src-depend"
description="Compiles the project.">
<echo>Compiling</echo>
<javac target="${javac.target}"
source="${javac.source}"
debug="${javac.debug}"
srcdir="${src.dir}"
destdir="${bin.dir}">
<classpath>
<path refid="runtime.classpath"/>
<path refid="compile.classpath"/>
</classpath>
</javac>
</target>
但是,我第一次运行编译任务我总是得到一个StackOverflowException。如果我再次运行该任务,编译器会执行增量构建,并且一切正常。这是不受欢迎的,因为我们使用CruiseControl来进行自动日常构建,这会导致构建失败失败。
作为一种快速而肮脏的解决方案,我创建了两个独立的任务,分别编译项目的各个部分。我真的不认为这个解决方案会成功,因为将来会增加更多的类,并且我不希望每次达到“编译限制”时都要增加新的编译任务。
它抛出一个StackOverflowException - 所以你来责怪我们? :-) – kenj0418 2009-06-25 05:10:55
@ kenj0418 - 你的评论真的让我挠我的脑袋,直到我看到笑脸。好的! – 2009-06-25 18:18:19