# Gradle Release Notes

We are excited to announce Gradle 9.2.0-20250821001437+0000 (released 2025-08-21).

This release features 1, 2, ... n, and more.

We would like to thank the following community members for their contributions to this release of Gradle:

Be sure to check out the public roadmap for insight into what's planned for future releases.

## Table Of Contents

## Upgrade instructions

Switch your build to use Gradle 9.2.0-20250821001437+0000 by updating the wrapper in your project:

    ./gradlew wrapper --gradle-version=9.2.0-20250821001437+0000 && ./gradlew wrapper

See the Gradle 9.x upgrade guide to learn about deprecations, breaking changes, and other considerations when upgrading to Gradle 9.2.0-20250821001437+0000.

For Java, Groovy, Kotlin, and Android compatibility, see the full compatibility notes.

## New features and usability improvements

### Publishing improvements

#### New `PublishingExtension.getSoftwareComponentFactory()` method

This release introduces a new method that exposes the `SoftwareComponentFactory` service via the `publishing` extension, simplifying the creation of publishable components. In many cases, a component is already present. For example, the bundled Java plugins already provide the `java` component by default. This new method is especially useful for plugin authors who want to create and publish custom components without needing to depend on the Java plugins.

The following example shows how to use this new method to publish a custom component:

    plugins {
        id("maven-publish")
    }

    val consumableConfiguration: Configuration = getAConfiguration()

    publishing {
        val myCustomComponent = softwareComponentFactory.adhoc("myCustomComponent")
        myCustomComponent.addVariantsFromConfiguration(consumableConfiguration) {}

        publications {
            create<MavenPublication>("maven") {
                from(myCustomComponent)
            }
        }
    }

#### New provider-based methods for publishing configurations

Two new methods have been added to `AdhocComponentWithVariants` which accept providers of consumable configurations:

- `void addVariantsFromConfiguration(Provider<ConsumableConfiguration>, Action<? super ConfigurationVariantDetails>)`
- `void withVariantsFromConfiguration(Provider<ConsumableConfiguration>, Action<? super ConfigurationVariantDetails>)`

These complement the existing methods that accept realized configuration instances.

With this new API, configurations can remain lazy and are only realized when actually needed for publishing. Consider the following example:

    plugins {
        id("base")
        id("maven-publish")
    }

    group = "org.example"
    version = "1.0"

    val myTask = tasks.register<Jar>("myTask")
    val variantDependencies = configurations.dependencyScope("variantDependencies")
    val myNewVariant: NamedDomainObjectProvider<ConsumableConfiguration> = configurations.consumable("myNewVariant") {
        extendsFrom(variantDependencies.get())
        outgoing {
            artifact(myTask)
        }
        attributes {
            attribute(Category.CATEGORY_ATTRIBUTE, objects.named<Category>("foo"))
        }
    }

    publishing {
        val component = softwareComponentFactory.adhoc("component")
        // This new overload now accepts a lazy provider of consumable configuration
        component.addVariantsFromConfiguration(myNewVariant) {}

        repositories {
            maven {
                url = uri("<your repo url>")
            }
        }
        publications {
            create<MavenPublication>("myPublication") {
                from(component)
            }
        }
    }

With this approach, the `myNewVariant` configuration will only be realized if the `myPublication` publication is actually published.

## Promoted features

Promoted features are features that were incubating in previous versions of Gradle but are now supported and subject to backward compatibility. See the User Manual section on the "Feature Lifecycle" for more information.

The following are the features that have been promoted in this Gradle release.

### Daemon toolchain is now stable

Gradle introduced the Daemon toolchain in Gradle 8.8 as an incubating feature. Since then the feature has been improved and stabilized. It is now considered stable and will no longer print an incubation warning when used.

## Fixed issues

## Known issues

Known issues are problems that were discovered post-release that are directly related to changes made in this release.

## External contributions

We love getting contributions from the Gradle community. For information on contributing, please see gradle.org/contribute.

## Reporting problems

If you find a problem with this release, please file a bug on GitHub Issues adhering to our issue guidelines. If you're not sure if you're encountering a bug, please use the forum.

We hope you will build happiness with Gradle, and we look forward to your feedback via Twitter or on GitHub.