I am defining a new task in Ant. I exported it as a jar and added to my buildfile:
The pro
If you know the path of your jar, inside ant script you can define the classpath for your own task.