Using the AntBuilder
seems to be the best way to create a backup zip file in Groovy. There are lots of solutions on this site that use methods like copy
and zip
but I can't see those methods the AntBuilder
class in Groovy 2.1.5. Do I need to install an additional Jar?
new AntBuilder().zip(
destfile: "mydir/myzip.zip") {
fileset(dir: "mydir/myFile.txt")
}