I have not been able to duplicate this with ant head of ant 1.6.1.

I tried the following:

<project default="t">
 <target name="t">
   <macrodef name="compile">
     <sequential>
       <javac fork="yes" srcdir="src" destdir="classes"/>
     </sequential>
   </macrodef>
   <compile/>
 </target>
</project>

And tried to get the javac to fail by changing the permission
of the classes directory, and also by moving the javac program.
In both cases the stacktrace was available with a -verbose flag
to ant.

Peter

Dominique Devienne wrote:

I have a <macrodef> that wraps a <javac> which in this case forks. The
forked javac fails, but the 1.6 code for MacroInstance seems to eat up the
stack traces for the nested exception, and displays only the message of the
outermost exception. I suspect that the exception here is a BuildException,
which wraps the IOException and it's message, which would tell me exactly
why it failed.

I'll try to temporarily copy the content of the <macrodef> in place of the
macro use itself, to get a better error message, but it would be nice it
using <macrodef> was not behaving differently than the same Ant code running
outside a macrodef.

Thanks, --DD

BUILD FAILED
C:\acme\build.xml:243: Following error occured while executing this line
C:\acme\build.xml:233: Error running javac.exe compiler
       at
org.apache.tools.ant.ProjectHelper.addLocationToBuildException(ProjectHelper
.java:574)
       at
org.apache.tools.ant.taskdefs.MacroInstance.execute(MacroInstance.java:345)
       at
org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:306)
       at org.apache.tools.ant.Task.perform(Task.java:401)
       at org.apache.tools.ant.Target.execute(Target.java:338)
       at org.apache.tools.ant.Target.performTasks(Target.java:365)
       at org.apache.tools.ant.Project.executeTarget(Project.java:1237)
       at org.apache.tools.ant.Project.executeTargets(Project.java:1094)
       at org.apache.tools.ant.Main.runBuild(Main.java:669)
       at org.apache.tools.ant.Main.startAnt(Main.java:220)
       at org.apache.tools.ant.launch.Launcher.run(Launcher.java:215)
       at org.apache.tools.ant.launch.Launcher.main(Launcher.java:90)

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]







---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to