Hi
We use the below approach, using <extendclasspath> that comes with the 
cenquatasks-1.3.8.jar. It fixed it for me while I had exactly your problem.
Define your own lib.dir for this.

<property name="lib.cenquatasks" value="cenquatasks-1.3.8.jar" />
<property name="lib.junit" value="junit-3.8.1.jar" />
<property environment="env" />
<!-- junit and clover need to be added to the default classpath -->
                <taskdef resource="com/cenqua/ant/antlib.xml" 
classpath="${lib.dir}/${lib.cenquatasks}" />
                <extendclasspath path="${lib.dir}/${lib.junit}" />
        
<taskdef name="junit" 
classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTask">
                        <classpath>
                                <pathelement 
location="${env.ANT_HOME}/lib/ant-junit.jar" />
                                <pathelement 
location="${env.ANT_HOME}/lib/${lib.junit}" />
                                <pathelement location="${lib.dir}/${lib.junit}" 
/>
                        </classpath>
                </taskdef>


Hope it helps you.
Met vriendelijke groet,

Rémon van Gijn
Port infolink b.v.

-----Original Message-----
From: Roman Gavrilov [mailto:[EMAIL PROTECTED] 
Sent: donderdag 20 april 2006 15:48
To: Ant Users List
Subject: RE: Extend lib-path

RG>I have a task that depend on a .jar. Is there a way to point 
RG>the ant to the .jar in question from within build file? I.e. 
RG>kind of set -lib from the script?

Jan> Providing that inside the classpath of <taskdef> ?

Doesn't work, it complains that it "could not create task junit!", but
if I run ant as "ant -cp ..\lib\junit.jar" it works just fine.

Task def looks as follows:
    <taskdef resource="net/sf/ant4eclipse/antlib.xml"
"classpath="${TOOLS_HOME}/ant4eclipse-0.3.2.jar">
        <classpath>
            <pathelement location="${LIB_PATH}/junit.jar" />
        </classpath>
    </taskdef>

BTW, The task itself does not allow nested classpath elements.

Roman

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to