ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Donald <>
Subject Re: Interfacing with Ant in JSP
Date Thu, 11 Jan 2001 06:17:29 GMT
At 01:00  11/1/01 -0500, Scott "M." Stirling wrote:
>This rocks!  Thanks for this response.  It's good someone else realizes
>this is a) a good idea (the abstract idea we're both hitting on), and b)
>not a piece of cake to re-use existing task classes without the Project
>context.  So far the suggestions I've gotten from others have been of
>the "just do it this way..." variety, but no less half-baked than my own

;) kewl - unfortunately we are alone except for one other person thou ;) So
we will have to be extra loud ;)

>I'd heard of Avalon, but no clue what it was.  I'm reading up on that at

feel free to pop on list or mail if you have questions.

>I tried to just build myrmidon by executing the buildfile, but that
>didn't work.  Looks like I need Avalon and maybe some other stuff to
>compile.  Any hints appreciated.  I have all the jars I need for
>building the latest Ant, Catalina, etc.  So if it's a Jakarta project, I
>usually first try my luck with the existing CLASSPATH in my antrc., then
>start digging/asking.

should be able to 

> cd proposals/myrmidon
> build.[sh|bat]

Does this work - and if not whats the error ?

>Anyway, a couple specific points answered below.  I have some reading to
>do and then I'll catch up more.


>On 11 Jan 2001 14:00:30 +1100, Peter Donald wrote:
>> At 09:46  10/1/01 -0500, Scott Stirling wrote:
>> >1. Make all (give or take a few) of the Ant tasks available as stand-alone
>> >JSP custom actions (no Project context required), 
>> Unfortunately we can't for Ant1.x for backwards compatability reasons but
>> thats precisely the thing I advocated ages ago when I first joined the ant
>> list - it was ignored then because it was so different but hopefully now I
>> have it in the myrmidon proposal it may get in ;)
>Well, I was looking at scenario 1 (below) and implementing tasks as JSP
>tags, completely ripped away from Ant and modified to be JSP tag handler
>classes instead of Tasks.  So there's no backward compatibility issue in
>my mind.  In a sense, the scenario 1 (below, from my first email) is
>almost like a fork of Ant, except it's not because it's more like a rape
>and pillage of Ant, leaving the carcass behind.

thats what I essentially did - it ended up being waay ugly thou and
difficult to maintain as I only nabbed the core tasks (copy/move etc) which
happen to get updated frequently ;)

>> >and 2) throwing JspTagExceptions
>> >in places where an Ant task would throw a BuildException.
>> I am not sure this is the right thing to do. Are JspTagExceptions
>> RuntimeExceptions or just normal exceptions ?
>I think it's the right thing to do in the case where you want a task's
>functionality, but you want the exception thrown to be one from the JSP
>tag API.  JspExceptions and their kids, JspTagExceptions, are regular
>Exceptions.  BuildExceptions would be appropriate for the scenario 2,
>where Ant tasks are used in the more traditional, project /target
>/workspace-oriented manner.

Hmm okay - then that would break in myrmidon as currently the "work" is
done via Runnable interface so you can't declare non-runtime exceptions.
Perhaps a proxy could work in this case that essentially did

public void execute()
  throws JSP...
  try {; }
  catch( final AntException ae )
     throw new JSP...( "Exception: " + ae.getMessage() );

>> >and 2) task-tags can take sub-tags
>> >where appropriate, such as <property> or <fileset> elements.
>> Have it implemented in myrmidon but I didn't check it in because it is
>> those evil if/else tags but I can check it in if you want ?
>I'd like to see that.  
>Thanks again, Pete.  You've given me some good food for thought.

I will check it in next time I am fiddling with it then ;)



| "Faced with the choice between changing one's mind, |
| and proving that there is no need to do so - almost |
| everyone gets busy on the proof."                   |
|              - John Kenneth Galbraith               |

View raw message