EDIT: I ended up setting up the whole project in Eclipse and was able to get it to build. I'm not sure why this problem occurred and hopefully I'll never have to find out.
I'm having a problem where my build is reporting "BUILD FAILED" without reporting any errors.
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.
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)
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.
Here's the target in ant:
<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>
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?