You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Pa...@clearstream.com on 2006/02/16 10:13:19 UTC

Classpath problem

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"/>
    </path>

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

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

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?

Thanks!
Paulo

-----------------------------------------
To make communications with Clearstream easier, Clearstream has
recently changed the email address format to conform with industry
standards. The new format is 'firstname.familyname@clearstream.com'.

Visit us at http://www.clearstream.com

IMPORTANT MESSAGE

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.

END OF DISCLAIMER