After importing ant script fails to run deploy task from gradle

Hello,

I am working on a multi project build file. In this build file, I would also like to import the existing ant build scripts. I have this code:

//Import existing ant build script for app services
task buildAppServices(){
  ant.properties.baseDir = rootProject.file('services/php/app/')
  ant.importBuild(rootProject.file('services/php/app/build.xml'))
}

Using this script, I am able to import all of my tasks in Gradle as it shows them when I see it via ./gradlew tasks However, when I run my task e.g. deploy_app (which is from ant build script), it throws this error:

Problem: failed to create task or type sshexec

Cause: the class org.apache.tools.ant.taskdefs.optional.ssh.SSHExec was not found.
This looks like one of Ant’s optional components.
Action: Check that the appropriate optional JAR exists in
-ANT_HOME/lib
-the IDE Ant configuration dialogs

I have this lib installed as I am able to execute this ant build separately without any issues. Can any one let me know where does the gradle script expect this library to be present for ant? Thanks