New major version 4.0.0 of gradle-download-task

Today, I’m happy to announce the new major version 4.0.0 of the popular gradle-download-task. With this Gradle plugin, you can download files in your build scripts and display progress information. The new version contains many new features and updating is recommended for all users.

gradle-download-task screencast

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

The new version has been tested with Gradle 2.0 up to 5.4.1 but should be compatible to any newer version as well.

New features

  • I relocated the Apache HttpClient library. In earlier versions, some users experienced dependency conflicts, in particular if they were using the Android Gradle plugin. This should not happen anymore because the HttpClient is now isolated and in its own package.
  • Error messages now contain HTTP status codes (see issue #115)
  • It is now possible to automatically retry failed requests (#83)
  • The timeout property has been renamed to connectTimeout and readTimeout (#126). See migration notes below.
  • URLs of failed downloads are now logged to the console (#127)


  • I removed properties deprecated in earlier versions
  • Support for Gradle 1.x and Java 6 has been dropped
  • I added integration tests for Gradle up to version 5.4.1
  • All unit tests have been migrated to WireMock for better maintenance
  • I fixed a couple of compiler warnings

Bug fixes

  • Compression is now really disabled if the compress flag is false
  • PlainConnectionSocketFactory.INSTANCE is now explicitly registered for HTTP (#133)
  • I fixed a number of assertion errors (#114)
  • HTTP responses will now always be closed even if they failed

Migrating from version 3.x to 4.x

In this new major version, I made the following breaking changes to the API:

  • The plugin now requires Gradle 2.x (or higher) and Java 7 (or higher)
  • I removed the timeout property and introduced connectTimeout and readTimeout instead. This allows you to control the individual timeouts better. Also, it improves compatibility with Gradle 5.x, where all tasks have a timeout property by default.
  • The credentials property has been removed. The same applies to the possibility to pass instances of Apache HttpClient’s AuthScheme to the authScheme property. The strings Basic and Digest are now the only accepted values. There is no replacement. If you need this functionality, please file an issue.
  • The properties requestInterceptor and responseInterceptor have been removed. There is no replacement. Again, if you need this functionality, please file an issue.

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 you to read my blog post on 10 recipes for gradle-download-task to get an idea what you can do with the plugin.

Profile image of Michel Krämer

Posted by Michel Krämer
on 6 July 2019

Next post

citeproc-java 2.0.0 has just been released

The new major version offers support for Java 11 and is able to import YAML files. To improve performance, a GraalVM-based JavaScript runner has been added. The update also fixes a few minor bugs.

Previous post

Dynamic SSE for storing geospatial data in the cloud

We present an approach to store encrypted geospatial data in the cloud while maintaining searchability. Compared to other approaches, ours allows users to dynamically add or remove data.

Related posts

10 recipes for gradle-download-task

gradle-download-task is a Gradle plugin that allows you to download files during the build process. This post summarizes common patterns and use cases of gradle-download-task and provides useful tips and tricks.

New features in gradle-download-task 3.4.0

Version 3.4.0 of the popular Gradle plugin contains many new features. Highlights are the support for ETags and downloading to a temporary file. The update also contains various other improvements.

New major version 5.0.0 of gradle-download-task

I’ve just released gradle-download-task 5.0.0. The new version now downloads multiple files in parallel, executes concurrently with other build tasks, and offers better support for Kotlin and Gradle 8.