ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject Classpath problem
Date Thu, 16 Feb 2006 09:13:19 GMT

Hi all,

I’m having a very odd problem concerning the used classpath in ant targets.
I have target1 and target2 like this:

<path id="target1.classpath">
        <pathelement location="${build.folder}"/>
        <pathelement location="${lib.folder}/junit/3.8.1/junit.jar"/>
        <pathelement location="${lib.folder}/jmock/jmock-1.0.1.jar"/>
        <pathelement location="${lib.folder}/jmock/jmock-cglib-1.0.1.jar"/>
        <pathelement location="${lib.folder}/jmock/cglib-full-2.0.2.jar"/>

    <target name="target1">
        <junit printsummary     = "on"
               showoutput       = "yes">
            <classpath refid = " target1.classpath "/>
            <formatter type     = "xml"/>
            <formatter type     = "plain"/>
            <batchtest todir="${junit.out.folder}">

<target name="target2">
        <wlserver dir="${wls.domain.conf}" weblogichome="${wls.home}"
                  port="${wls.port}" action="start"
servername="${wls.server}" policy="${wls.home}/lib/weblogic.policy"
                  username="${wls.username}" password="${wls.password}">

Basically, target1 is running a set of JUnit and Mock tests, and target2 is
starting WebLogic. If I try to run both targets separately everything goes
fine. The problem is if I create a third target that runs both target1 and
target2 in sequence. Target1 runs fine and then target2 fails with an
exception related with Mock objects. Therefore, it seems that the classpath
that I define for target1 is available to target2 as well. I would expect
that the classpath that I define is just local to the target I’m running.
Is this assumption correct? Is there any way that I can run both targets in
sequence, without “inheriting” the classpath from target1 at target2 level?


To make communications with Clearstream easier, Clearstream has
recently changed the email address format to conform with industry
standards. The new format is ''.

Visit us at


Internet communications are not secure and therefore Clearstream
International does not accept legal responsibility for the contents of
this message.

The information contained in this e-mail is confidential and may be
legally privileged. It is intended solely for the addressee. If you are
not the intended recipient, any disclosure, copying, distribution or
any action taken or omitted to be taken in reliance on it, is
prohibited and may be unlawful. Any views expressed in this e-mail are
those of the individual sender, except where the sender specifically
states them to be the views of Clearstream International or of any of
its affiliates or subsidiaries.

View raw message