https://gradle.com/ logo
Join Slack
Powered by
# community-support
  • l

    Lex Manos

    09/03/2026, 11:12 PM
    With IDE Task Deprecation What is the replacement for adding extra properties to the eclipse model. Specifically trying to enable annotation processors, which the current solution is the goomph apt plugin. Buildship doesn't seem to have anything related to annotation processors in its code.
  • t

    Thomas Keller

    09/04/2026, 11:15 AM
    So I regularly have to clean out my
    $GRADLE_USER_HOME/.gradle/caches/<version>/transforms
    directory which is gathering multiple gigabytes worth of duplicated transformed libraries that get generated through my multi component build. Now I know Gradle is first about correctness and speed and secondly only cares about optimizing cache sizes and the like, but I really, really would love to have some option in Gradle to clear outdated / unused caches. Not only transforms, but in general also cache folders from older Gradle versions, old cached distributions and the like. I know I could write a script and do it myself in one go, but then Gradle daemons need to be stopped properly, no new Gradle daemons must be started (otherwise Gradle stumbles upon corrupted caches) and in general I think it's Gradle's task to deal with its caches, not only creating them, but also keeping them under control. Is anything planned in this direction / is there eventually a ticket that I could subscribe to that would deal with that?
    plus1 3
    a
    s
    v
    • 4
    • 6
  • w

    willbanders

    09/04/2026, 8:12 PM
    Hi, I'm experiencing the issue below specifically when using Gradle 9.7.1 via the gradle wrapper.
    Copy code
    ./gradlew --version
    ...
    Caused by: java.lang.ClassNotFoundException: org.apache.tools.ant.launch.AntMain
    Reverting to Gradle 9.7.0 (manually updating
    gradle-wrapper.properties
    , since gradlew commands don't work) fixes this issue - output of
    ./gradlew --version
    in thread. I had a project working with Gradle 9.7.1 as of a week ago but it seems to be failing now - is there any chance this is some form of upstream dependency issue?
    v
    • 2
    • 6
  • h

    Hamza GATTAL

    09/05/2026, 11:18 PM
    Hey — publishing a version catalog with the
    version-catalog
    plugin, using
    .withoutVersion()
    on most libraries and only
    versionRef
    on a BOM alias. Minimal repro:
    Copy code
    // build.gradle.kts
    plugins {
        `version-catalog`
    }
    catalog {
        versionCatalog {
            val versionAlias = version("mylib", "1.0.0")
            library("bom", "com.example", "mylib-bom").versionRef(versionAlias)
            library("core", "com.example", "mylib-core").withoutVersion()
        }
    }
    Generated TOML:
    Copy code
    [versions]
    mylib = "1.0.0"
    
    [libraries]
    bom = { group = "com.example", name = "mylib-bom", version.ref = "mylib" }
    core = { group = "com.example", name = "mylib-core", version = "" }
    If a consumer forgets to apply the BOM as a platform:
    Copy code
    dependencies {     
       implementation(platform(libs.mylib.bom))
       implementation(libs.mylib.core) // no platform applied
    }
    ...resolution fails with
    Could not find com.example:mylib-core:.
    — which makes sense once you know the empty version is intentional, but the error message doesn't hint at the cause at all. A couple questions: 1. Is there a way to make Gradle emit a clearer error here — something that mentions the missing platform/BOM rather than just a blank version? 2. Is
    .withoutVersion()
    + BOM the recommended pattern for a multi-module library's catalog, or is there a more idiomatic way to enforce "must be used with platform X" at the catalog level? Trying to figure out if I should adopt this for my own multi-module project's catalog or just keep
    versionRef
    on every library instead.
    v
    • 2
    • 1
  • r

    rushikesh.jawali

    09/14/2026, 4:33 PM
    Hello, recently came across news that Gradle cache nodes are deprecated and will not be available to use after end of this year docs.develocity.ai/bcn/21.2. Are there any alternatives of cache node? also do we know how can we able to get access to docs.develocity.ai/edge/2.2 or paying for the Develocity is the only option as we only use gradle cache node on CI side.. any help or suggestion will be appreciated!
    m
    e
    +3
    • 6
    • 11
  • e

    Edwin Günthner

    09/16/2026, 6:45 PM
    We are using MavenArtifactRepository to wire our dependencies to our own internal Artifactory instance. User provide their id and artifactory token via their gradle.properties file ... everything pretty standard. But thing is. it happens quite often that the users have an invalid artifactory token. And if that happens and gradle needs to download from our artifactory server, the error that users see looks like this:
    Copy code
    * What went wrong:
    Plugin [id: 'org.gradle.kotlin.kotlin-dsl', version: '6.6.4'] was not found in any of the following sources:
    
    - Gradle Core Plugins (plugin is not in 'org.gradle' namespace)
    - Included Builds (No included builds contain this plugin)
    - Plugin Repositories (could not resolve plugin artifact 'org.gradle.kotlin.kotlin-dsl:org.gradle.kotlin.kotlin-dsl.gradle.plugin:6.6.4')
      Searched in the following repositories:
        maven(<https://eu.artifactory.whatever.com/artifactory/foobarblub>)
    Token invalid , download not possible, but a "not found error" In order to make our tooling more user friendly, we added a "ping" check to our toplevel settings.gradle file. Artifactory servers have a "ping" endpoint, so do a GET request ... and if that fails with a 401 or 403, the token is not valid, and we can print a nice error message. But: this means that any single gradle invocation sends such a "ping" to the Artifactory servers. And now we regularly see failures on our CI build servers with Artifactory complaining about "too many requests". Before we had this "ping" solution, we tried to somehow "catch" the actual "not found error" that I showed above, but I couldn't get that to work reliably. Any idea if/how we can reliably give "good" error messages when Artifactory downloads fail (because of that bad token), without hammering the servers with every gradle invocation?
    p
    v
    l
    • 4
    • 15
  • n

    N Murali

    09/17/2026, 8:58 AM
    Hi
    👋 3
  • n

    N Murali

    09/17/2026, 9:00 AM
    I am getting this below error always in Android Studio while Synching the Project with Gradle Files. Any help from anyone please? FAILURE: Build failed with an exception. * What went wrong: Process 'command 'node'' finished with non-zero exit value 1 * Try:
    Run with --info or --debug option to get more log output.
    Get more help at help.gradle.org.
    CONFIGURE FAILED in 38s
    v
    l
    • 3
    • 4
  • r

    roger.lee

    09/19/2026, 10:27 AM
    Ran 'gradle update/upgrade' and tried to upgrade to 9.7.1_1 on macOS Golden Gate 27.0 (26A428) to: ==> Would upgrade 3 outdated packages gradle 9.7.1 -> 9.7.1_1 (157.4MB) When I run: Gradle to build my EAR I get: Downloading services.gradle.org/distributions/gradle-9.7.1_1-bin.zip Exception in thread "main" java.io.FileNotFoundException: downloads.gradle.org/distributions/gradle-9.7.1_1-bin.zip at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1727) at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1311) at java.base/sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:223) at org.gradle.wrapper.Install.forceFetch(SourceFile:2) at org.gradle.wrapper.Install$1.call(SourceFile:8) at org.gradle.wrapper.GradleWrapperMain.main(SourceFile:67) Downloading services.gradle.org/distributions/gradle-9.7.1_1-bin.zip Exception in thread "main" java.io.FileNotFoundException: downloads.gradle.org/distributions/gradle-9.7.1_1-bin.zip at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1727) at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1311) at java.base/sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:223) at org.gradle.wrapper.Install.forceFetch(SourceFile:2) at org.gradle.wrapper.Install$1.call(SourceFile:8) at org.gradle.wrapper.GradleWrapperMain.main(SourceFile:67) Downloading services.gradle.org/distributions/gradle-9.7.1_1-bin.zip Exception in thread "main" java.io.FileNotFoundException: downloads.gradle.org/distributions/gradle-9.7.1_1-bin.zip at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1727) at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1311) at java.base/sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:223) at org.gradle.wrapper.Install.forceFetch(SourceFile:2) at org.gradle.wrapper.Install$1.call(SourceFile:8) at org.gradle.wrapper.GradleWrapperMain.main(SourceFile:67)
    y
    t
    l
    • 4
    • 13
  • y

    ysb33r

    09/21/2026, 3:53 PM
    Does anyone have practical examples for using
    addLater
    or
    addAllLater
    on a domain collection especially on a named collection?
    p
    v
    • 3
    • 15
  • y

    ysb33r

    09/21/2026, 5:05 PM
    @Vampire W.r.t. https://gradle-community.slack.com/archives/CAHSN3LDN/p1790009935682299?thread_ts=1790005987.739679&amp;cid=CAHSN3LDN I am pulling this into a separate conversation: I have noticed in the later Gradle 9 versions that if you have some task class that is statically compiled Groovy 3.x (plugin built under Gradle 8.x) and it uses a
    onlyIf {}
    within that class, it fails when configuration cache is active. I have not spent enough time investigating it, but the couple of times I saw it was enough to irritate me
    v
    • 2
    • 4
  • a

    Adam

    09/24/2026, 9:45 AM
    I'm working on improving the UX of https://github.com/adamko-dev/dev-publish-plugin, a helper plugin for testing modules via publishing (without Maven Local, and build-cache friendly). It publishes to a local directory using a regular maven-publish repo, but adds addition up-to-date checks. One rough edge: if a project enables signing unconditionally (i.e. without something like
    signing.setRequired { <project has tasks that publish to Maven Central> }
    ), then dev-publish also triggers signing, which fails on machines/CI without signing keys. Afaict it's not possible to disable signing per repository. The fix I'm looking at is skipping signing when only dev-publish tasks are in the task graph then disable the sign tasks (e.g. via
    Sign.onlyIf {}
    ). But I'm not sure whether this should be a default opt-out behaviour, or an opt-in behaviour. Should dev-publish... 1. Automatically disable signing when only dev-publish tasks are requested? 2. Or just detect that signing is enabled but not configured, and warn/fail with a hint like "conditionally disable signing for local testing"?
    y
    • 2
    • 2
  • a

    Adam

    09/24/2026, 9:51 AM
    Another thing: I want to use the Problems API to add a warning, but it doesn't log any message to console. This means when signing fails for dev-publish users basically only see the 'signatory not configured' failure, and it's hard to discover the softer warning which would help. Why aren't Problems API warnings printed to the console? Is there a way to make them move visible? Or should dev-publish use error-level warnings instead? Or dev-publish should log warnings to the console and via Problems API?
    v
    • 2
    • 6
  • m

    Martin

    09/24/2026, 1:19 PM
    Can I react to a configuration being registered ? (Not configured)
    v
    e
    t
    • 4
    • 14
  • r

    Robert Elliot

    09/29/2026, 6:08 PM
    I was a bit surprised to find myself writing this... is it because it's a dreadful idea?
    Copy code
    fun Test.envVarInput(envVar: String) {
      val value = providers.environmentVariable(envVar)
      inputs.property(envVar, value).optional(true)
      doFirst {
        val dbTypeResolved = value.orNull
        if (dbTypeResolved != null) {
          environment(envVar, dbTypeResolved)
        } else {
          environment.remove(envVar)
        }
      }
    }
    
    tasks.test {
      envVarInput("ENV_VAR_READ_BY_TESTS")
    }
    p
    • 2
    • 4
  • r

    Robert Elliot

    09/30/2026, 8:33 AM
    Just before I make an arse of myself by raising an IntellJ issue... IntelliJ is raising a warning "Dependency is declared multiple times" for this:
    Copy code
    dependencies {
      runtimeOnly(libs.jersey.media.sse)
      testImplementation(libs.jersey.media.sse)
    }
    I think that's a bug and this declaration is correct - the lib is a compile time dependency for test but only a runtime dependency for main.
    v
    • 2
    • 10
  • t

    tony

    09/30/2026, 9:09 PM
    I'm trying to implement an
    AttributeDisambiguationRule
    . I'm getting an illegal argument exception:
    Copy code
    Unable to determine constructor argument #1: missing parameter of type ObjectFactory, or no service of type ObjectFactory.
    (note in case anyone wonders: this is the
    org.gradle.api.model.ObjectFactory
    ) Here's a simplified version that includes just the relevant details:
    Copy code
    // plugin class
    attribute(BuildTypeAttr.ATTRIBUTE).run {
      disambiguationRules.add(AndroidBuildTypeDisambiguationRule::class.java)
    }
    
    // separate class
    abstract class AndroidBuildTypeDisambiguationRule @Inject constructor(
      private val objects: ObjectFactory,
    ) : AttributeDisambiguationRule<BuildTypeAttr> {
      override fun execute(details: MultipleCandidatesDetails<BuildTy
        val release = objects.named(BuildTypeAttr::class.java, "release")
      }
    }
    When I run this, it fails with:
    Copy code
    1: Task failed with an exception.
    -----------
    * What went wrong:
    Execution failed for task ':platform:generateMetadataFileForPlatformPublication' (registered by plugin 'org.gradle.maven-publish').
    > Could not resolve project ':producer-android'.
       > Could not select value from candidates [debug, release] using AndroidBuildTypeDisambiguationRule.
          > Could not create an instance of type com.autonomousapps.platformbuilder.internal.utils.attributes.AndroidBuildTypeDisambiguationRule.
             > Unable to determine constructor argument #1: missing parameter of type ObjectFactory, or no service of type ObjectFactory.
    My code looks like an exact replicate of the example in the Gradle docs here. What am I doing wrong?
    ❓ 1
  • t

    tony

    10/03/2026, 8:55 PM
    I'm trying to refactor my plugin to use
    configurations.named()
    instead of
    configurations.getByName()
    , and ran into an issue that ultimately looks like this:
    Copy code
    - Task `:lib:findNativeLibsDebug` of type `com.autonomousapps.tasks.FindNativeLibsTask`: cannot serialize object of type 'org.gradle.api.internal.artifacts.result.DefaultResolvedArtifactResult', a subtype of 'org.gradle.api.artifacts.result.ArtifactResult', as these are not supported with the configuration cache.
      See <https://docs.gradle.org/8.11.1/userguide/configuration_cache.html#config_cache:requirements:disallowed_types>
    I experimented and I no longer get that issue from Gradle 9.5.0. I'm looking at the release notes for that release, and there's nothing obviously related to this issue. The nearest thing I can see is https://github.com/gradle/gradle/issues/35318. What am I missing? Is my code only working in newer releases by accident? I think this is from this in my task:
    Copy code
    @get:Internal
    public abstract val androidJni: SetProperty<ResolvedArtifactResult>
    
    @Optional // Only available on Android
    @PathSensitive(PathSensitivity.RELATIVE)
    @InputFiles
    public fun getAndroidJniFiles(): Provider<List<File>>? {
      if (!androidJni.isPresent) return null
      return androidJni.map { artifactResults -> artifactResults.map { it.file } }
    }
    
    @Input
    public fun getAndroidJniIdentifiers(): Provider<List<String>> = androidJni.identifiers()
    ✅ 1
    p
    m
    • 3
    • 14
  • b

    Brice Dutheil

    10/12/2026, 2:31 PM
    I just stumbled on
    TaskDependency
    this looks like a useful mechanism to provide tasks that can only be generated very late (with generated names). In particular I found it instrumental to avoid
    afterEvaluate
    . However the javadoc is a tad misleading as it applies not only to
    dependsOn
    .
    p
    • 2
    • 6
  • c

    calebb2048

    10/12/2026, 3:53 PM
    My project structure: • :common ◦ compiles against ASM ◦ ensures both the runtime and compiler plugin are emitting/decoding the same insns the same way • :runtime ◦ dependsOn(:common) ◦ ASM location:
    org.objectweb.asm
    • :compiler-plugin ◦ dependsOn(:common) ◦ ASM location:
    <http://org.jetbrains.org|org.jetbrains.org>.objectweb.asm
    How do I make
    :compiler-plugin
    compile against a version of my
    :common
    project with every ASM reference relocated to the new location? I've tried an artifact transform, but I can't even tell if it's being executed. I know this is brittle, but it's ASM; the API is literally never going to change.
    t
    v
    • 3
    • 28
  • p

    Philip W

    10/14/2026, 6:25 AM
    Why do I get this error message when the task itself is UP-TO-DATE?
    Copy code
    Calculating task graph as configuration cache cannot be reused because an input to task ':build-logic:jar' has changed.
    > Task :build-logic:checkKotlinGradlePluginConfigurationErrors SKIPPED
    > Task :build-logic:compileKotlin UP-TO-DATE
    > Task :build-logic:compileJava NO-SOURCE
    > Task :build-logic:pluginDescriptors UP-TO-DATE
    > Task :build-logic:processResources UP-TO-DATE
    > Task :build-logic:classes UP-TO-DATE
    > Task :build-logic:jar UP-TO-DATE
    v
    • 2
    • 9
  • b

    Brice Dutheil

    10/14/2026, 12:25 PM
    Is there a reason why configuration cache it not enabled during IDE sync ? docs.gradle.org/current/…/performance.html#…
    v
    • 2
    • 3
  • g

    Gionata Legrottaglie

    10/16/2026, 3:59 PM
    Hi, my account on discuss.gradle.org legrottaglie.gionata was automatically put on hold after I posted about Gradle Task Debugger, an open-source Eclipse plugin that lets you debug Gradle tasks from Buildship. A user has since asked me a question there that I can’t answer. Could a moderator review it? Thanks!
    v
    l
    • 3
    • 2
  • b

    Brice Dutheil

    10/17/2026, 10:38 AM
    Hi there, How are you handling test "matrixes" ? Currently I have seen and practiced different approaches, which are not mutually exclusive. 1. Using properties to modify something, one need to pass the
    -Pxxx
    to the cli, this is quite flexible, this is ok for CI pipelines, workflows, but it's discoverability is not great locally. And clearly don't handle well the idea of running a matrix. 2. Using tasks, (eventually with an aggregating task) it requires to registering each task (this can always be done programmatically, e.g. via plugin) 3. Using test suites, which also leads to test tasks. The challenge is balancing discoverability, local execution speed (because some runs might be too long for feedback loop), local availability of the required dependencies (some can be only available in CI env), ability to run/exclude a single "matrix config" locally. Things I've had to deal with in regard of matrix, different dependency versions, different toolchain, different "properties" that could affect the exercised code (e.g. via a file on disk, a system property, jvm arg etc.)
    t
    v
    j
    • 4
    • 12
  • v

    Vlastimil Brecka

    10/18/2026, 12:30 AM
    Is there a way to lint build files? Say to ban "inline" 3rd party dependency declarations, to force to use the version catalogue?
    t
    v
    +3
    • 6
    • 80
  • v

    Vlastimil Brecka

    10/19/2026, 11:46 PM
    What is IP-safe way of “apply this plugin everywhere”? like root, settings, i.e. every .gradle file
    e
    v
    j
    • 4
    • 9
  • s

    Sergej Koščejev

    10/20/2026, 5:40 PM
    How do I make Gradle repository credentials inaccessible to agents? E.g. one agent ran
    gradlew properties
    and the credentials got into the tool output.
    👀 1
    v
    t
    v
    • 4
    • 12
  • v

    Vlastimil Brecka

    10/20/2026, 7:06 PM
    I wanna report So I managed to get
    isolated projects
    working in a 550 project build - and config time droped to 4-6 seconds (from around 10-14). So -+ 50%, which is in line with this one blog post I read which I cannot remember where 😄 Nice
    🎉 2
    👌 1
    party gradlephant 2
    v
    • 2
    • 1
  • v

    Vlastimil Brecka

    10/20/2026, 11:28 PM
    Does anyone know why, when I rerun (100% up-to-date cache hits) an assemble task via cli, I get "BUILD SUCCESSFUL in 1s" and when I run the same command via intellij run config "BUILD SUCCESSFUL in 4s"? i.e. way slower for same operation - what is the IDE doing extra? Is it maybe the console output writing? Thats the only difference I see (default vs --console=plain)
    v
    j
    +2
    • 5
    • 6
  • p

    Philip W

    10/22/2026, 8:36 AM
    How can I append a Provider<String> to a Property<String> (update the value)?
    Copy code
    val foo: Property<String> = objects.property()
    foo.set("foo")
    val toAdd: Provider<String> = provider { "toAdd" }
    foo.set(foo.zip(toAdd) { foo, toAdd -> foo + toAdd })
    println(foo.get()) // I want to get "fooToAdd"
    v
    a
    • 3
    • 6