蚂蚁构建失败,没有可见错误 [英] Ant build fails with no visible errors
问题描述
我最终在Eclipse中设置了整个项目,并能够进行构建.我不确定为什么会发生此问题,希望我永远不必找出原因.
我遇到一个问题,我的建筑报告"BUILD FAILED",但没有报告任何错误.
I'm having a problem where my build is reporting "BUILD FAILED" without reporting any errors.
我正在构建许多旧代码的大型应用程序,现在我可以进行修改了.其他大多数开发人员都使用Eclipse建立了他们的构建,但是我试图通过现有的build.xml文件来构建它.
I'm building a large application of a lot of old code which I now have the joy of modifying. Most of the other developers have set up their builds with Eclipse, but I'm trying to build it through the existing build.xml files.
设置好我的类路径后,构建可以顺利运行,但是在开始编译步骤后不久,它会返回:
After getting my classpath set, the build runs smoothly, but shortly after starting the compile step, it returns:
Lots of "[javac] file.java" lines.
BUILD FAILED
<project path>/build.xml:201: Compile failed; see the compiler error output for details.
这没有帮助.除了堆栈跟踪,build.log没有其他信息:
This is less than helpful. The build.log has no additional information other than the stack trace:
at org.apache.tools.ant.taskdefs.Javac.compile(Javac.java:1085)
at org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:885)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:357)
at org.apache.tools.ant.Target.performTasks(Target.java:385)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337)
at org.apache.tools.ant.Project.executeTarget(Project.java:1306)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1189)
at org.apache.tools.ant.Main.runBuild(Main.java:758)
at org.apache.tools.ant.Main.startAnt(Main.java:217)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)
在蚂蚁上添加-debug
标志会创建大量信息,而类路径这么长(这么多的jar),很难对其进行分类.
Adding the -debug
flag to ant creates mountains of information, and with such a long classpath (so many jars) it is hard to sort through it.
这是蚂蚁的目标:
<target name="compile" depends="achmetadata">
<mkdir dir="${path.build.classes}"/>
<javac
listfiles="yes"
destdir="${path.build.classes}"
classpathref="project.classpath"
debug="on"
deprecation="on"
fork="yes"
nowarn="no"
memoryMaximumSize="512M"
srcdir="${path.src.java}"
source="1.4"
target="1.4"
>
-><src path="${path.build.src}"/>
<patternset refid="production-code"/>
</javac>
</target>
classpath是通过该classpathref设置的,并且通过和标签包含了很多jars.
The classpath is set through that classpathref and has a lot of jars included through and tags.
对我应该寻找的东西有什么想法吗?会导致蚂蚁失败的原因是什么?
Any thoughts on what I should be lookinf for? What would cause ant to fail like this?
推荐答案
您可以在调试模式下运行ant构建,以便逐步进行吗?在build.xml中设置一个断点.然后右键单击build.xml并选择Debug As-> Ant Build(假设您正在使用Eclipse).这可以帮助您找出问题所在.
Can you run your ant build in debug mode so that you can step through it? Set a break point in your build.xml. Then Right click on the build.xml and select Debug As -> Ant Build (assuming you are using Eclipse). This might help you to figure out your issue.
HTH.
这篇关于蚂蚁构建失败,没有可见错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!