Classpath error with Ant task

I can create an EAR file successfully on my local machine using:

ant.taskdef(name: "serviceDeploy", classname:"") {
  classpath {
    fileset(dir: "wasHome/plugins", includes "")


However, when my Gradle script is run from Jenkins, I see:

java.lang.NoClassDefFoundError: org/apache/xml/serialize/OutputFormat
Caused by: java.lang.ClassNotFoundException: org.apache.xml.serialize.OutputFormat

In my dependencies block, I’ve declared the dependency for the xercesImpl jar, and when I print the classpath for dependencies, I can see the xercesImpl jar. How can I determine the exact error and the solution for this problem?

I’m assuming the class is not in the jar. If you unzip and look inside it, is there a file at the path org/apache/xml/serialize/OutputFormat.class?

I’m guessing that you need to add extra jars (ie the transitive dependencies of to the classpath