import org.xapek.yvesf.gradle.DownloadTask version '3.3.9' task download(type: DownloadTask) { source "http://mirror.switch.ch/mirror/apache/dist/maven/maven-3/${version}/binaries/apache-maven-${version}-bin.tar.gz" sha256sum '6e3e9c949ab4695a204f74038717aa7b2689b1be94875899ac1b3fe42800ff82' } task unpack(type: Copy) { from tarTree(download.destFile) into file("${buildDir}/unpacked/dist") eachFile { FileCopyDetails fcd -> fcd.path = fcd.path.substring(path.indexOf('/')+1) } } unpack.dependsOn(download) ospackage { into "/opt/${project.name}" from unpack.outputs.files }