After importing ant script fails to run deploy task from gradle


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(){ = rootProject.file('services/php/app/')

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 was not found.
This looks like one of Ant’s optional components.
Action: Check that the appropriate optional JAR exists in
-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