Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » How to use Tomcat custom Ant tasks in Eclipse
How to use Tomcat custom Ant tasks in Eclipse [message #155648] Thu, 22 April 2004 21:34 Go to next message
Eclipse UserFriend
Originally posted by: blackhole.hvc.rr.com

I have a working build.xml that uses the Tomcat 5 custom InstallTask. I want to
be able to build the project using Eclipse 2.1.1 on Win2K but I'm having trouble
configuring Eclipse so Ant recognizes the custom task. If I use Preferences >
Ant > Runtime > Classpath and add the jar that contains the task definition
(catalina-ant.jar), the build fails with the message "taskdef class
org.apache.catalina.ant.InstallTask cannot be found". If I then use Preferences
> Ant > Runtime > Tasks and define a task that references the Tomcat jar file,
I get the error "java.lang.NoClassDefFoundError: org/apache/tools/ant/Task".
ant.jar is included in the Runtime classpath.

How do I configure Eclipse so build.xml can use custom tasks?

Thanks,
Mike
Re: How to use Tomcat custom Ant tasks in Eclipse [message #161833 is a reply to message #155648] Fri, 28 May 2004 16:41 Go to previous message
Eclipse UserFriend
Originally posted by: blackhole.hvc.rr.com

Solution: add classpath (or classpathref) to taskdefs for Tomcat tasks; e.g.,

<path id="tomcat.tasks.classpath"
path="${jwsdp.home}/server/lib/catalina-ant.jar" />

<taskdef name="install"
classname="org.apache.catalina.ant.InstallTask"
classpathref="tomcat.tasks.classpath" />

Mike

> I have a working build.xml that uses the Tomcat 5 custom InstallTask. I
> want to be able to build the project using Eclipse 2.1.1 on Win2K but
> I'm having trouble configuring Eclipse so Ant recognizes the custom
> task. If I use Preferences > Ant > Runtime > Classpath and add the jar
> that contains the task definition (catalina-ant.jar), the build fails
> with the message "taskdef class org.apache.catalina.ant.InstallTask
> cannot be found". If I then use Preferences > Ant > Runtime > Tasks and
> define a task that references the Tomcat jar file, I get the error
> "java.lang.NoClassDefFoundError: org/apache/tools/ant/Task". ant.jar is
> included in the Runtime classpath.
>
> How do I configure Eclipse so build.xml can use custom tasks?
>
> Thanks,
> Mike
>
Previous Topic:Do you have variable names starting with an underscore?
Next Topic:PicoConchaSuMadre
Goto Forum:
  


Current Time: Tue Jul 15 14:35:21 EDT 2025

Powered by FUDForum. Page generated in 0.05319 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top