Using CactusTask in Ant1.6

Hi, Im having real trouble using the CactusTask in Ant1.6, as a minimal test, I have the following ant script;

<project name="Cactus Test" default="init" basedir=".">
      <taskdef name="cactus" classname="org.apache.cactus.integration.ant.CactusTask">
            <classpath>
                        <pathelement location="cactus-ant-1.6.1.jar"/>
            </classpath>
      </taskdef>
</project>


now I have put cactus-ant-1.6.1.jar in the working dir and verified that org.apache.cactus.integration.ant.CactusTask is in it.
But when i run it i still get the following:

BUILD FAILED
file:C:/projects/Enterprise/CactusTests/build.xml:3: taskdef class org.apache.cactus.integration.ant.CactusTask cannot be found

Does anyone have any idea why this doesnt work?
Regards,
LVL 5
blackfrancis75Asked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
objectsConnect With a Mentor Commented:
try putting them in the lib directory of ant.
0
 
blackfrancis75Author Commented:
I tried that and it doesnt help...
0
 
blackfrancis75Author Commented:
further to this problem, i just ran it with ant - verbose on and I got this:

--- Nested Exception ---
java.lang.NoClassDefFoundError: junit/framework/TestListener
        at java.lang.Class.getDeclaredConstructors0(Native Method)
        at java.lang.Class.privateGetDeclaredConstructors(Class.java:1610)
        at java.lang.Class.getDeclaredConstructors(Class.java:1169)


I tries putting the junit jar in the ANT lib directory but this didnt help...
0
 
blackfrancis75Author Commented:
I found this in the JUnit doco:

Note: You must have junit.jar and the class files for the <junit> task in the same classpath. You can do one of:

1.Put both junit.jar and the optional tasks jar file in ANT_HOME/lib.
2.Do not put either in ANT_HOME/lib, and instead include their locations in your CLASSPATH environment variable.
3.Do neither of the above, and instead, specify their locations using a <classpath> element in the build file. See the FAQ for details.

I tried all three of these to no avail...
0
 
blackfrancis75Author Commented:
OK well i have resolved this - Im not sure what was wrong but I installed a completely new version of ANT and moved the JUnit jar file into ANT\lib and it seems to work ok now.
0
All Courses

From novice to tech pro — start learning today.