Gradle Plugin De.undercouch.download !!install!! -
task downloadZip(type: Download) { src 'https://example.com' dest new File(buildDir, 'temp.zip') } task setupAssets(type: Copy) { dependsOn downloadZip from zipTree(downloadZip.dest) into 'src/main/assets' } Use code with caution. 📋 Configuration Options Description src The URL(s) to download. dest File/String The destination directory or file. overwrite Whether to overwrite existing files (default: true). onlyIfModified Only download if the server version is newer. compress Enable GZIP compression (default: true). header Custom HTTP headers. 💡 Why use this over curl or wget ?
The de.undercouch.download plugin is the gold standard for handling HTTP downloads within your Gradle builds. While Gradle has native support for dependencies, it often falls short when you need to fetch raw assets, binaries, or ZIP files from the web during a build task. gradle plugin de.undercouch.download
If your file is hosted behind a login, you can provide credentials easily: Uses standard username/password. Preemptive Auth: Sends credentials before the server asks. task downloadZip(type: Download) { src 'https://example
To use the plugin, you first need to add it to your build.gradle or build.gradle.kts file. Using the Plugins DSL plugins { id "de.undercouch.download" version "5.6.0" } Use code with caution. Legacy Plugin Portal header Custom HTTP headers




