ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Weiqi Gao <>
Subject Attribute vs. Element question again: classpath
Date Wed, 26 Sep 2001 04:08:46 GMT
Here's another Ant question I don't quite know the complete answer:

The obvious answer seems to be: 'of course you can have multiple
classpath elements.'  Would I be right in saying that?

In the Ant user manual, many tasks accept
a nested <classpath> element, which may be
used instead of the classpath and/or
classpathref attributes.

In each of these tasks, they say something
like "Java's classpath attribute is a 
PATH like structure and can also be set 
via a nested classpath element."

This implies that I can only add one
<classpath> element to tasks supporting
this feature. But in all of my tests
so far, I can add as many <classpath>
elements as I want to, and it seems
to work.

So what gives? Can I add many <classpath>
elements to tasks that support this
feature, or does Ant only technically
allow a single nested <classpath>
element? I've been digging through the
source code and haven't quite figured
out how this works.

Maybe multiple <classpath>s happen
to work for some tasks, but not all. I
hate to simply "assume" that I can
always add multiple classpaths as 
children, just because it happens
to work for some tasks.

Weiqi Gao

View raw message