title: Trying to use Tomcat Ant task in Gradle
body: <p>I am in the process of migrating from from Ant to Gradle.  I can't seem to find a better way to managing my tomcat deployments in Grade so I am trying to use the Tomcat Ant tasks from within Gradle but I can't get it work.</p>
  
  <p>Here is what I do in Ant which works</p>
  
  <pre><code> &lt;taskdef name="deploy" classname="org.apache.catalina.ant.DeployTask"/&gt;
  
   &lt;target name="deploy" description="Install web application"
        depends="dist"&gt;
      &lt;deploy url="${url}" username="${username}" password="${password}"
          path="/${contextName}" war="${DIST}/${contextName}.war"/&gt;
   &lt;/target&gt;
  </code></pre>
  
  <p>So in Gradle and I am trying to use the Ant task like this</p>
  
  <pre><code>ant.taskdef(name:"deploy", classname:"org.apache.catalina.ant.DeployTask", 
      classpath: "PATH_TO_catalina-ant.jar")
  
  ant.deploy(url="http://localhost:8080/manager/text" username="user" password="pass"
          path="/app" war="dist/app.war")
  </code></pre>
  
  <p>When I run the task with the <code>--debug</code> flag I can see that the task is getting loaded property from the JAR</p>
  
  <pre><code> Class org.apache.catalina.ant.DeployTask loaded from ant loader (parentFirst)
  </code></pre>
  
  <p>But I get this error message </p>
  
  <pre><code> Could not set unknown property 'war' for task ':deploy' of type org.gradle.api.DefaultTask.
  </code></pre>
  
  <p>WAR is definitely a property of this task but the fact that the error message is calling it <code>DefaultTask</code> makes me think the <code>taskdef</code> is not setup properly but I'm not sure.  In reality nothing is working because if I remove "war" then it just complains the same about the next property I defined.</p>
  
  <p>I am using Gradle 3.5</p>