Skip to content
Snippets Groups Projects
java.md 7.26 KiB
title: Java Versions
description: Java versions support in Renovate

Java Dependency Updates

Renovate can update Gradle and Maven dependencies. This includes libraries and plugins as well as the Gradle Wrapper.

LTS releases

The config:recommended preset includes the workarounds:javaLTSVersions preset. The workaround limits Renovate to upgrade to LTS versions of the Java runtime only.

If you want Renovate to offer all major Java updates then add workarounds:javaLTSVersions to the ignorePreset array:

{
  "extends": ["config:recommended"],
  "ignorePresets": ["workarounds:javaLTSVersions"]
}

Gradle

Renovate detects versions that are specified in a string 'group:artifact:version' and those specified in a map (group:groupName, name:ArtifactName, version:Version).

Gradle File Support

Renovate can update:

  • *.gradle/*.gradle.kts files
  • Dependencies with version definitions in gradle.properties files
  • Gradle lockfiles stored in *.lockfile files
  • *.versions.toml files in any directory or *.toml files inside the gradle directory (Gradle Version Catalogs docs)
  • versions.props and versions.lock from the gradle-consistent-versions plugin

Renovate does not support:

  • Android projects that require extra configuration to run (e.g. setting the Android SDK)
  • Catalogs with version ranges
  • Catalog versions using reject, and rejectAll constraints
  • Catalog versions using more than one of require, strictly, prefer in a single declaration
  • Catalogs with custom names that do not end in .toml
  • Catalogs outside the gradle folder whose names do not end in .versions.toml (unless overridden via fileMatch configuration)

Gradle Wrapper

Renovate can update the Gradle Wrapper of a project.

This includes the source declaration inside the gradle/wrapper/gradle-wrapper.properties as well as accompanied files such as gradlew, gradlew.bat, and gradle/wrapper/gradle-wrapper.jar.

How It Works

Renovate extracts the Gradle Wrapper version used from the distributionUrl inside the gradle-wrapper.properties. Once the version is determined, Renovate will look for newer versions from the gradle-version datasource. Renovate will then invoke the Gradle Wrapper to update itself, as recommended by Gradle.

For the extraction to work, the distributionUrl must point to a file of type .zip, which includes the version in its name, and defines one of the official distribution types (bin, all).

Support for mirrors and custom distributions

As Renovate takes the distributionUrl defined inside the gradle-wrapper.properties as basis for its update, source declarations other than to the official Gradle Wrapper are supported.

This can be used for hosting the official distributions with a proxy server, an offline mirror or even providing a custom distribution of the Gradle Wrapper, e.g. to provide a company-wide base configuration for all Gradle projects.

But the gradle-version datasource is used to determine available versions. In case the available versions at the defined source differ from those available from Gradle or the default datasource cannot be reached, e.g. due to network restrictions, the datasource may be reconfigured via a packageRule:

{
  "packageRules": [
    {
      "matchDatasources": ["gradle-version"],
      "registryUrls": [
        "https://domain.tld/repository/custom-gradle-wrapper/versions.json"
      ]
    }
  ]
}

Maven

Renovate can update dependency versions found in Maven pom.xml files.

Maven File Support

Renovate will search repositories for all pom.xml files and processes them independently.

Renovate will also parse settings.xml files in the following locations: