troubleshooting Question

ant task

Avatar of komlaaa
komlaaa asked on
16 Comments1 Solution533 ViewsLast Modified:
I am using the ant file below to deploy my webapp
I add "catalina-ant.jar" as follow:
right click on build.xml > Run As --> Ant Build ... --> Classpath -- > Add external JARs, then browse to catalina-ant.jar

but all the task are  "underlined" as 'cannot be found'
what should do?

===============build.xml ============
<?xml version="1.0" encoding="UTF-8"?>
<project name="antJUnitJDK5Features" default="create-war" basedir="C:/eclipse/workspace/antJUnitJDK5Features">

  <!-- Configure the directory where Tomcat 5.0 is -->
  <property name="local-tomcat" value="C:/Tomcat5"/>
       <!-- Configure the directory into which the Web application is built -->
  <property name="build"    value="${basedir}/build"/>

  <!-- Configure the context path for this application -->
  <property name="path"     value="/antJUnitJDK5Features"/>

  <!-- Configure properties to access the Manager application -->
  <property name="url"      value="http://localhost:8080/manager/html"/>
  <property name="username" value="theValue"/>
  <property name="password" value="thePassword"/>
  <!-- Configure the custom Ant tasks for the Manager application -->
  <taskdef name="deploy"    classname="org.apache.catalina.ant.DeployTask"/>
  <taskdef name="list"      classname="org.apache.catalina.ant.ListTask"/>
  <taskdef name="reload"    classname="org.apache.catalina.ant.ReloadTask"/>
  <taskdef name="resources" classname="org.apache.catalina.ant.ResourcesTask"/>
  <taskdef name="roles"     classname="org.apache.catalina.ant.RolesTask"/>
  <taskdef name="start"     classname="org.apache.catalina.ant.StartTask"/>
  <taskdef name="stop"      classname="org.apache.catalina.ant.StopTask"/>
  <taskdef name="undeploy"  classname="org.apache.catalina.ant.UndeployTask"/>

  <!-- Executable Targets -->  
 <target name= "create-war">
    <property name= "war-base" value="${local-tomcat}/Webapps/antJUnitJDK5Features/"/>

       <war destfile="${build}/antJUnitJDK5Features.war" Webxml="${basedir}/WebContent/WEB-INF/Web.xml">
           <fileset dir="${basedir}/html"/>
            <classes dir= "${basedir}/build/classes">
                      <exclude name="index.html"/>
                      <exclude name="Web.xml"/>
                      <exclude name="antJUnitJDK5Features.war"/>

  <target name="deploy" description="Install Web application"
    <deploy url="${url}" username="${username}" password="${password}"
            path="${path}" war="${build}${path}.war"/>

  <target name="reload" description="Reload Web application"
    <reload  url="${url}" username="${username}" password="${password}" path="${path}"/>

  <target name="undeploy" description="Remove Web application">
    <undeploy url="${url}" username="${username}" password="${password}"

Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 16 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 16 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros