When I run a scriptdef like: <scriptdef name="quickfail" language="beanshell"> <![CDATA[ self.fail("I failed!"); ]]> </scriptdef> I expect to get an output like: BUILD FAILED C:\myproject\build.xml:10: [quickfail] I failed! Or something of the sort... Instead I get: BUILD FAILED javax.script.ScriptException: Sourced file: inline evaluation of: ``self.fail("I failed!"); ;'' : Method Invocation self.fail : at Line: 3 : in file: inline evaluation of: `` self.fail("I failed!"); '' : self .fail ( "I failed!" ); Target exception: I failed! in inline evaluation of: `` self.fail("I failed!"); at line number 3 ''; at bsh.engine.BshScriptEngine.evalSource(BshScriptEngine.java:86) at bsh.engine.BshScriptEngine.eval(BshScriptEngine.java:46) at javax.script.AbstractScriptEngine.eval(Unknown Source) .BshScriptEngine.evalSource(BshScriptEngine.java:86) at bsh.engine.BshScriptEngine.eval(BshScriptEngine.java:46) at javax.script.AbstractScriptEngine.eval(Unknown Source) [...it keeps going for 3 more pages, making the original error very hard to read...] I'm willing to grudgingly accept such an output for an IOException, or even a syntax error, but for a user-generated fail? What's the point of providing a custom fail command if it looks like a full system crash? I haven't checked if this is beanshell specific, or if it applies to javascript and other languages as well, since I only have beanshell installed.
I haven't tried beanshell but JavaScript in svn revision 793540 When using Apache BSF things are just like one would want them to be - a one line "I failed!" message. But using javax.script things look ugly. Unfortunately the scripting engine throws a ScriptException without any nested cause in this case, completely hiding the original BuildException. The beanshell implementation may be doing better, in which case the changes committed in above revision may help. If it doesn't, then I'm afraid there isn't anything we can do from Ant's side. Using WONTFIX as a placeholder for CANTFIX.