ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Peter Reilly" <>
Subject Re: classloader for 1.7
Date Wed, 23 Aug 2006 11:45:07 GMT
Yes, classloader issues do give me headaches.

I see a number of use cases for the classloader task;

1) stop the need to do add third-party jars to ~/.ant/lib for
    the ant optional tasks.
    This could be avoided if all the optional task are converted a la junit,
    but that would be a big job.

2) allow build files to specify the lib directories to seach for
    placing this on the command line is very offputting.

The antlibs solution would be ok, but it does not solve ant optional tasks
issues like the script task needing language specific jar files. Each of
these may be solved independently, but this means that each type of
classloader problem would be solved differently - hard to understand and


On 8/23/06, Jesse Glick <> wrote:
> Peter Reilly wrote:
> > If it is not a little too late, I would like to get a vote
> > on including classloader into ant 1.7.
> +0.5 I guess, if someone is testing it carefully (URLClassLoaderAdapter
> in particular is a little unnerving). Really the advantage #1,
> "to avoid the need to either change Ant's default installation by adding
> or removing jars to or from Ant's lib dir or manage the classpath in the
> launching script"
> is a workaround for Ant's inability to autoload antlibs from a defined
> classpath. Would be better to be able to say e.g.
> <target name="init">
>    <antlibs>
>      <fileset dir="lib" includes="**/*.jar"/>
>    </antlibs>
> </target>
> <target name="whatever" depends="init" xmlns:f="">
>    <f:stuffWorks/>
> </target>
> where the <antlibs> call just registers a fileset (or, internally,
> ClassLoader) and any later attempt to use a namespace automatically
> checks for a matching antlib.xml, without touching the startup class
> loader. It's a problem in Ant core that it cannot autodetect antlibs
> except in Ant's startup loader.
> Another issue is just that people are often intimidated by
> ClassLoader's: they work logically once you get it, but getting it is
> like math homework. Exposing a <classloader> task for widespread
> consumption may make Ant seem for "experts only". Of course you don't
> have to use the task if you don't want to, but what if we don't fix the
> usability problems that made the task necessary to begin with, and using
> <classloader> starts to be considered normal for Ant scripts?
> -J.
> --
>  x22801
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message