gradle-download-task 3.0.0

The new version of the Gradle plugin gradle-download-task 3.0.0 has just been released. The plugin provides a Download task that displays progress information while downloading files, just like Gradle does when it fetches an artifact from a repository.

Grab gradle-download-task 3.0.0 while it’s still hot:

The new version has been tested with Gradle 1.x up to 2.13 but should be compatible to any other version as well.

New features

In the new version the plugin’s core has been rewritten completely. gradle-download-task now uses Apache HttpClient instead of Java’s URLConnection. This enables a whole range of new features including support for authenticating proxies.

Proxy configuration

The new version allows you to configure a proxy server by setting standard JVM system properties. The plugin uses the same system properties as Gradle. You can set them in the build script directly. For example, the proxy host can be set as follows:

System.setProperty("http.proxyHost", "");

Alternatively, you can set the properties in a file like this:

Put this file in your project’s root directory or in your Gradle home directory.

HTTPS is also supported:

Automatically create target directory

gradle-download-task 3.0.0 automatically creates the target directory if multiple sources are set. For example, given the following task:

task downloadFile(type: Download) {
    dest "myTargetDirectory"

The target directory myTargetDirectory will be created automatically if it does not exist yet.

More information

If you want to learn more about the plugin have a look at its README file or at my earlier post.

I also strongly advice to read my blog post on 10 recipes for gradle-download-task to get an idea what you can do with the plugin.