ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ivan Ivanov <rambiusparkisan...@yahoo.com>
Subject Re: Customizing classpath for Ant's Script task
Date Fri, 24 Sep 2004 08:56:56 GMT
Just for your information Ant 1.6 has several
"default" places to search for external jars:
$ANT_HOME/lib, $HOME/.ant/lib and you can pass it
another location with -lib option given to ant
launching script:
ant -lib /dir/with/jar
So you are not bound to put everything you need in
$ANT_HOME/lib.

--- "Scott W. Ruch" <sruch@inventa.com> wrote:

> 
> 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
> 
> products.
> 
> 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>
>          <fileset dir="../lib">
>             <include name="our-private.jar"/>
>             <include name="log4j*.jar"/>
>          </fileset>
>       </path>
> 
>       <taskdef name="script"
>          classpathref="tools.classpath"
>         
>
classname="org.apache.tools.ant.taskdefs.optional.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"/>
>          </fileset>
>       </path>
> 
>       <taskdef name="script"
>          classpathref="tools.classpath"
>         
>
classname="org.apache.tools.ant.taskdefs.optional.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?
> 
> Thanks,
> 
> Scott
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> user-unsubscribe@ant.apache.org
> For additional commands, e-mail:
> user-help@ant.apache.org
> 
> 



	
		
__________________________________
Do you Yahoo!?
New and Improved Yahoo! Mail - 100MB free storage!
http://promotions.yahoo.com/new_mail 

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message