ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tim Dawson <>
Subject Ant2 - automatic taskdef registration?
Date Thu, 17 May 2001 15:43:11 GMT
(I sent this a few days ago but didn't see it come back to me in the list -
my apologies if this is a duplicate.)

Maybe this has already been proposed, but I looked in the Ant2 features and
didn't see anything about automatic taskdef registration.

I think we should look at copying the patterns established by EJB, JSP, and
Taglibs for using deployment descriptors in the jar file. The EJB jar file
uses an ejb-jar.xml file in the meta-inf directory. (why do war files use
web-inf instead of meta-inf? anyway, I digress)

I'd like to propose that instead of using the file in
the package, that we just use a deployment
descriptor - namely, meta-inf/ant-tasks.xml in the jar files, and when all
the jar files inside the ANT_HOME/lib directory are loaded, Ant just looks
for meta-inf/ant-tasks.xml, and when it finds one, it does the equivalent of
the <taskdef> automatically for each defined task.

That way, if I write a set of custom tags (or want to use some tasks
packaged by a third party), then drop a jar file in my ANT_HOME/lib

This would be useful for the current set of optional tasks too, so that they
would be "unknown" unless the jar file was there, rather than the way
they're currently automatically registered but you get a



View raw message