ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Martin van den Bemt" <>
Subject RE: [PROPOSAL] don't include optional.jar in the system classpath
Date Tue, 13 Nov 2001 22:34:42 GMT
See below..

> -----Original Message-----
> From: Mike Williams []
> Sent: Tuesday, November 13, 2001 11:32 PM
> To: Ant Developers List
> Subject: [PROPOSAL] don't include optional.jar in the system classpath
>   >>> On Tue, 13 Nov 2001 17:20:38 +0100 (CET),
>   >>> "Holger" == Holger Engels <> wrote:
>   Holger> The point is, that the tool's jars are loaded from the same
>   Holger> classloader as the tasks. As optional.jar is in the system
>   Holger> classloader, junit.jar has to reside there, too.
> Actually, the <junit> task is an excellent example.  As a
> developer, I want
> to ensure that the junit.jar used by the task is the same version I
> compiled my unit-tests with.  To achieve this now, I have to rely on
> external CLASSPATH setup before invoking Ant.  That smells.

You don't have to depend on that...

> This prompts me to ask the questions:
>   - Who should be in-control of the classpath for optional tasks: the Ant
>     user (who writes build.xml) or the Ant deployer?

You are.. The system classloader is never used, ant uses it's own

>   - Why include the "optional" tasks on Ant's classpath, when they won't
>     work without additional setup?

That's why it's just in the distro or you have to download it, becayse they
don't work by default.. (was a discussion on this list I seem to remember..)

> Personally, I'd prefer that (for instance) the <junit> task was NOT on the
> classpath by default.  Then, I could explicitly declare in my "build.xml",
> e.g.
>     <taskdef name="junit"
> classname="">
>         <classpath>
>             <pathelement location="${junit.lib}/junit.jar" />
>             <pathelement location="${ant.lib}/optional.jar" />
>         </classpath>
>     </taskdef>

Who is stopping you from doing that ?
<taskdef name="junit37" is a good example of how you could use it or just
don't use optional.jar or just create it yourselve with the stuff you want..

Ant is more flexible than you can imagine ;))


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

View raw message