ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Matt Raible" <mrai...@gmail.com>
Subject Is it possible to use <script> without putting JARs in $ANT_HOME/lib?
Date Tue, 04 Apr 2006 21:42:58 GMT
I'd like to use the <script> task without putting bsf.jar and js.jar
in ANT_HOME/lib.  Is that possible?

I tried the following, but no dice:

        <taskdef name="foo"
classname="org.apache.tools.ant.taskdefs.optional.Script">
        	<classpath>
        		<fileset dir="${ant-contrib.dir}" includes="*.jar"/>
        	</classpath>
        </taskdef>

		<!-- Using Javascript functions to capitalize and lowercase the model.name -->
         <foo language="javascript"><![CDATA[

             // getting the value
             lowercaseValue = project.getProperty("object.name");

             // the first character
             low = lowercaseValue.substring(0,1).toLowerCase();

             // the rest of the value
             rest = lowercaseValue.substring(1);

            // convert first character to uppercase
             up = low.toUpperCase();

             // concatenate the uppercase with the rest
             uppercaseValue = up + rest;
             lowercaseValue = low + rest;

             // store the result in a new property
             project.setProperty("model.name",uppercaseValue);
             project.setProperty("model.name.lowercase", lowercaseValue);

         ]]></foo>
    </target>

I get:

BUILD FAILED
java.lang.NoClassDefFoundError: org/apache/bsf/BSFException

If I move js.jar and bsf.jar in $ANT_HOME/lib, everything works fine. 
The main reason I want to keep the JARs in my project is because 1) I
don't want users to go through an extra "copy JARs into ANT_HOME/lib
step", and 2) I'm using Canoo WebTest uses a newer version of js.jar
(the latest version of rhino) and I don't want the conflict.

Thanks,

Matt

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


Mime
View raw message