days
-6
-1
hours
0
-1
minutes
-5
-6
seconds
-2
-1
search
Sweet 6.0

Gradle 6.0 brings Java 13 support, better dependency management & much more

Chris Stewart
gradle
© Shutterstock / Alias Ching (modified)

It’s not even been a year since Gradle 5.1 arrived in January, and yet here we are staring down the next major release: Gradle 6.0. This latest release of the build-automation software brings much improved features for dependency management, faster incremental compilation for Java and Groovy, support for Java 13, as well as out of the box support for javadoc and source jars. And that’s not all, so let’s take a closer look!

The second major Gradle version this year has landed – what a treat! Version 6.0 brings plenty of major changes, so let’s take a look at the highlights.

Dependency management

To make it easier to find what users are looking for, the team behind Gradle has restructured the dependency documentation around use cases and improved their terminology list to better explain commonly used terms.

They have also made the publication of Gradle Module Metadata the default option when using the maven-publish or ivy-publish plugins. This should be noted because many of the other new dependency management features, for example for sharing dependency versions between projects, expressing intent with context, or modeling feature variants and optional dependencies, require additional metadata not in Maven or Ivy POM files.

 

    In a cloud native world enamored with microservices and serverless, meet Quarkus – Java’s brilliant response to technologies like Node.js, Python and Go that had proven quicker, smaller and arguably more nimble. Download your free beginner's tutorial written by JAX London speaker Alex Soto.

Out of the box javadoc and source jar support

Using the following it is now possible to activate Javadoc and source jar publishing for Java libraries and projects:

java {
    withJavadocJar()
    withSourcesJar()
}

If this feature is activated, Java and Java library projects automatically generate the javadocJar and sourcesJar task.

SEE ALSO: Tooling as code – Having truly self-contained Gradle builds

Faster incremental compilation for Java and Groovy

Gradle’s incremental compiler can now limit the number of classes that need recompiling even more by excluding classes that are an implementation detail of another class. This has the potential to greatly reduce the compiling effort, especially for deeper dependency chains.

Support for Java 13

Very few surprises here. Java 13 was released in September, and now this JVM compiler is compatible with JDK 13. If this is anything to go by, perhaps Gradle 7.0 will land a month or two after JDK 14, sometime in May 2020, we’ll be keeping our eyes open for that one, too!

SEE ALSO: Quarkus 1.0.0: First Major Release for the Kubernetes-native Java Stack

Even more features

There are a lot more smaller changes and feature updates in Gradle 6.0, so why not go check them out in the Gradle 6.0 release notes? In the meantime, here’s a quick rundown of a choice few:

  • The Zinc compiler has been updated to make working on Scala projects easier
  • New APIs have been added for plugin authors to make connecting tasks and properties even more straightforward.
  • Added support for Visual Studio 2019 and the latest C++ standards.
  • And of course a jolly good dose of bug squashing and tidying up.

Will you be using Gradle 6.0 in your project? If you’re planning on upgrading then you can take a look at the compatibility notes or check out the Gradle 6.0 upgrade guide.

Author
Chris Stewart
Chris Stewart is an Online Editor for JAXenter.com. He studied French at Somerville College, Oxford before moving to Germany in 2011. He speaks too many languages, writes a blog, and dabbles in card tricks.

Leave a Reply

Be the First to Comment!

avatar
400
  Subscribe  
Notify of