ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jose Alberto Fernandez" <>
Subject RE: Antlib autoloading
Date Tue, 13 Sep 2005 10:22:43 GMT
> From: Stefan Bodewig []
> On Mon, 12 Sep 2005, Jose Alberto Fernandez
> <> wrote:
> > 1) How about collisions? Well, how about collisions between classes
> > in the classpath?
> Putting antlibs into namespaces was supposed to resolve those
> collisions, just like namesspaces in C++.

And no one is saying that should not continue to be the case, but if I
want to load something in the default name space, it is up to me to take
the risk.

> > How about loading a task that collides with one already defined in
> > What do we do in this case? Shall we react the
> > same way?
> Sure, this (complain loudly) is what we're doing with multiple
> <typedef>s for the same name as well.  it may just be annoying, so
> annoaying that people will avoid autoloading.

I do not buy too much this argument. If am "extending my ANT-CORE" with
some 3rd party tasks is because that library does not collide with
regular ANT tasks. This is the case of all the optional antlibs that we
provide. And it may be the case of some specialized ant-libraries
specific to some corporation. It is their job and their risk to try to
cohabitate with the ANT tasks. Otherwise, they should use and declare
name-spaces in their project files. 

> > 2) Shall we keep control on what gets aoutoloaded? I would say yes!
> Good 8-)
> > I disagree on having some global switch (option) instead I would
> > propose something like -lib (no autoloading) and -autolib (do
> > autoloading).
> But you'd use the same classloader for both, right?  Otherwise
> explaining Ant's classloaders becomes even more complex.

Well, this is just engineering ;-) There is a way to know where a
resource is coming from. We just need to examine what we allow in and
what we don't.

> > 3) Have an antlib.xml in META-INF for autoloading. My only misgiving
> > on doing it this way is the duplication of declarations.
> Matt's example of using different names for autoloads (that end up in
> the default namespace) and namespaced tasks would show an example of
> when you want to have separate files.  This may be a bit artificial,
> though.
This to me is the worst that we can do to ANT. How are people going to
understand that is you use auto-loading the tasks of some library have
some name, but if you do not, then they have some completely different
names, oh and by the way you ALSO need to define a name space for them.
Is there any other way to make things more confusing for people trying
to use reusable code? I doubt it.

Jose Alberto

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message