BT

InfoQ Homepage News Gradle 7.0 Released with Support for JDK 16

Gradle 7.0 Released with Support for JDK 16

Bookmarks

Gradle, the customizable open source build automation tool, has released version 7.0. This release comes with support for JDK 16, faster incremental builds, improved build reliability with validation errors, and native support for new Macs with Apple Silicon processors. In addition, some of the preview features like JVM toolchains, dependency locking, dependency verification, and support for Java Module System, introduced in earlier releases, have all been promoted as stable features in version 7.0.

Prior versions of Gradle would not run on the latest JDK 16. However, with the help of the JVM toolchains, and by disabling incremental compilation, one could still build their Java projects using JDK 16. With the latest 7.0 release of Gradle, both running Gradle and building projects on JDK 16 is fully supported. Gradle itself has been upgraded to use Groovy 3 in Groovy based DSL build scripts to fully support JDK 16. Groovy 3 is packed with new features and capabilities that also support interoperability with newer Java features. Note that Groovy 2 and Groovy 3 aren’t fully compatible with each other and as a result may cause issues when upgrading to Gradle 7.0. Consult Gradle’s upgrade instructions for further guidance.

Each release of Gradle continues to bring speed improvements to incremental builds. This release enables the optimized file system watching feature by default on all supported platforms like Windows, Linux, and MacOS. The optimization helps Gradle to learn about the changes to the build input and output files and retain that info in memory between builds. This allows Gradle to skip reading from the file system on each build thereby reducing the amount of disk I/O needed to determine the input and output file changes between builds.

Another build speed improvement was delivered in this release by ignoring empty buildSrc folders. Prior to this release, presence of a buildSrc folder would force Gradle to execute all related tasks potentially causing build cache misses and an additional performance overhead. Gradle will now ignore empty buildSrc folders thereby skipping execution of unnecessary tasks and avoiding cache misses.

One of the prominent stable features of Gradle 7.0 release is the full support for the Java module system. Users can now build, test, and run Java modules via Gradle. The mere presence of module-info.java will let Gradle infer that your jar is a module and has to be put on the modulepath instead of the traditional classpath.

Plugin development improvements like support for plugins with multiple variants, using included builds for local plugins, fixes for security advisories, dependency locking improvements, the experimental version catalogs, and type safe project accessors are some of the other noteworthy improvements and features in Gradle 7.0.

We need your feedback

How might we improve InfoQ for you

Thank you for being an InfoQ reader.

Each year, we seek feedback from our readers to help us improve InfoQ. Would you mind spending 2 minutes to share your feedback in our short survey? Your feedback will directly help us continually evolve how we support you.

Take the Survey

Rate this Article

Adoption
Style

Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Community comments

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

BT

Is your profile up-to-date? Please take a moment to review and update.

Note: If updating/changing your email, a validation request will be sent

Company name:
Company role:
Company size:
Country/Zone:
State/Province/Region:
You will be sent an email to validate the new email address. This pop-up will close itself in a few moments.