ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Klaus Malorny <>
Subject Libraries for optional tasks defined from within build.xml
Date Sat, 15 Dec 2007 16:17:59 GMT


sorry if this is a newbie question, but I did not find an answer in docs, faqs, 
google etc.

I'm using Ant 1.7, and I would like to use the <script> and <scriptdef> tasks
solve a particular problem. Since these are optional tasks, they need various 
libraries when run under Java5. So far, I was able to run a little "hello world" 
script. But what really bothers me is that I either have to copy the libraries 
into my ant installation or have to use the "-lib" option for each of the three 
libraries. As I want to distribute the project and as it shall be platform 
independent, writing a shell script or a Windows batch file is not really the 
solution I imagine. I would prefer to reference the libraries from within the 
build.xml file, like it is done with <typedef>/<taskdef> for external tasks. 
Trying to use the <typedef> mechanism for this purpose failed; An attempt to 
override the "script" task results in an error "Trying to override old 
definition of task script"; choosing a different name reveals that the libraries 
are not found despite being referenced (maybe ant uses a different class loader 
for that purpose).

    <path id="lib.path">
       <fileset dir="lib" includes="**/*.jar"/>


Any help is highly appreciated.


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

View raw message