ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dave Westerman <>
Subject RE: Putting Classpath Into My Own Ant Task
Date Wed, 09 Jun 2004 19:43:28 GMT
Dominique, thanks for the quick reply!

Using the embedded classpath in the taskdef sounded like the best option for me, so I tried
the following:

  <taskdef name="WaaderXtractor"
           classname="" >
    <classpath >
      <pathelement location="${Waader.jar}" />
      <pathelement location="C:/WebSphere/AppServer/lib/wjmxapp.jar" />
      <pathelement location="C:/WebSphere/AppServer/lib/admin.jar" />

  <target name="extract" description="WaaderXtractor" >
    <WaaderXtractor earFile="${Waader.ear.file}"
                    propOutput="${Waader.prop.output}" >

My Ant task, and my utility which it calls, are both in the $(Waader.jar} file, and they are
found just fine. But my 3rd party jars are still not found. I have checked and double-checked
(and even triple-checked!) that the locations are correct, that the jars exist, and that they
have the classes I need. But it doesn't seem to know the jars are in the classpath. i even
changed the order of the pathelements to put the 3rd party ones first, but it still doesn't
work. I'm probably doing something really stupid, but I can't figure out what is going on.

Finding class
Class loaded from parent loader
Class loaded from ant loader
 +User task: WaaderXtractor
 +Target: extract
   +Task: WaaderXtractor
Class java.lang.String loaded from parent loader
Finding class
Class loaded from ant loader
Class loaded from
parent loader
BUILD FAILED: java.lang.NoClassDefFoundError:


At 01:10 PM 6/9/2004, you wrote:

>No, no, no. If your task depend on 3rd party classes, then it will never be
>loaded unless these classes are available, so your task having a <classpath>
>nested element does no good.
>The 3rd party classes you require either must be in the system CLASSPATH, or
>in ant/lib (as JARs), or specified explicitly at <taskdef> time in a nested
><classpath>. --DD


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message