ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Scott W. Ruch" <>
Subject Customizing classpath for Ant's Script task
Date Thu, 23 Sep 2004 21:17:40 GMT

We've just upgraded to 1.6.2 and in the process we're
trying to tighten-up things up a bit.  The new policy
is that all widely-used 3rd-party libraries are placed 
in ANT_HOME/lib for all scripts to access.  We have a few
Ant scripts that employ Javascript via the Script task with
BSF & Rhino, so we put those jars in $ANT_HOME/lib as well.

The problem is that certain scripts need additional
jars for use in Javascript - and those we don't want
to put in $ANT_HOME/lib since they are our own build 

Before we switched over to 1.6.2 and keeping the 3rd
party libs in $ANT_HOME/lib, we used to set up
the classpath for the Script task like this:

      <path id="tools.classpath">
         <fileset dir="../lib/ant">
            <include name="bsf.jar"/>
            <include name="js.jar"/>
            <include name="optional.jar"/>
         <fileset dir="../lib">
            <include name="our-private.jar"/>
            <include name="log4j*.jar"/>

      <taskdef name="script"

Now that some of the jars are in $ANT_HOME/lib, we're trying
to do this:

      <path id="tools.classpath">
         <fileset dir="../lib">
            <include name="our-private.jar"/>

      <taskdef name="script"

But no matter how we attempt to craft the classpath, Ant
will not load the classes in "our-private.jar" and hence 
the javascript eventually fails.

We've also tried setting different values of "build.sysclasspath",
but that has no effect on this behavior.

Short of writing our own custom Script task - or putting our
private jars in $ANT_HOME/lib, is there any way around this?



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

View raw message