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

    Lucas Holden

    08/12/2025, 11:16 PM
    I have two configurations extending one another. How do you make sure the sub-configuration actually takes the exact same files as the super-configuration's, instead of going off and resolving completely different variants on its own?
    v
    • 2
    • 8
  • j

    James Smith

    08/12/2025, 11:37 PM
    having trouble for the first time while building my bundle with the key hash discrepancy my gradle.properties file stores the key pass and keystore pass, and when I build, it wants to escape the characters in my password... any solutions, what other info would be needed to help if so?
    v
    • 2
    • 5
  • l

    Lucas Holden

    08/13/2025, 7:42 PM
    I have a
    MapProperty<String, List<Object>>
    in my plugin extension. I need another plugin to merge items into the map instead of overwriting it like
    put
    does. I thought this would work:
    Copy code
    extMap.putAll(extMap.map { m ->
       m.keys.forEach { k ->
          m.merge(k, myValues(), { l1, l2 -> l1 + l2 })
       }
       return@map m
    })
    but instead it causes a stack overflow error due to the value depending on itself. I also can't add elements in
    Project.afterEvaluate
    because
    MapProperty#get
    returns an ImmutableMap. How do I add items to the lists in the map?
    a
    v
    • 3
    • 3
  • t

    tony

    08/15/2025, 5:53 PM
    This is a question about the java-platform plugin (or really, just about dependency constraints), and how that interacts or doesn't with variants. for Gradle projects with test fixtures (more generally: additional variants), do we need to declare the constraint multiple times?
    j
    • 2
    • 4
  • b

    Behnam Banaei

    08/16/2025, 7:27 AM
    Hey everyone. We've just migrated our Android team's git repos to a monorepo with the Gradle build system at its root. It consists of 3 large apps and multiple small libraries (150k lines of code in total). The issue is that devs are getting lots of performance issues when opening the monorepo in the Android studio regarding build time and indexing (find usages, navigating in the project, ...). What have we potentially done wrong in the process of migration and what are the solutions for this type of isses?
    v
    • 2
    • 1
  • c

    Caleb Cushing

    08/16/2025, 12:58 PM
    ... what happened to the great propertization ... v9 appears to have fixed zero of my "I need this to be lazy" issues, publishing still appears to be eager, version is eager... checkstyle still compiles java (even though checkstyle itself doesn't need that)
    v
    • 2
    • 2
  • j

    Javi

    08/16/2025, 2:51 PM
    Has someone seen this crash after upgrading to Gradle v9? The full stacktrace does not point to any code I own in my convention plugins 🤔
    Copy code
    * What went wrong:
    A problem occurred configuring project ':semver-gradle-plugin'.
    > Failed to notify project evaluation listener.
       > Cannot mutate the hierarchy of configuration ':semver-gradle-plugin:apiElements' after the configuration was published as a variant. After a configuration has been observed, it should not be modified.
       > Gradle Module Metadata can't be modified after an eagerly populated publication.
    v
    • 2
    • 16
  • j

    Javi

    08/17/2025, 10:29 AM
    Hello!
    dependencyProject
    is deprecated but on the deprecation it is not shown any alternative 🤔
    v
    • 2
    • 7
  • u

    محمد اسامه البدوي

    08/17/2025, 11:52 AM
    Hello!
    Copy code
    What is the solution to this error?
    ``````
    v
    • 2
    • 1
  • m

    Mez

    08/17/2025, 10:04 PM
    Hi everyone 🤗 Our Gradle project has slowly become a mess. An actual ball of spaghetti. Projects depending on projects everywhere with deep paths from our app project to our lowest level project. I tried using a plugin such as this one Graph Assert (https://github.com/jraska/modules-graph-assert) to understand the scale of the problem (it's big) but am struggling to figure out some proper next steps. The goal would be to improve build speeds and enforce a better Gradle graph health going forward. Has anyone faced similar challenges? And would they be able to offer some concrete suggestions for how to plan our way out of this? The project is about 130 modules (Android and Kotlin with some legacy Java) at the moment and takes about 25 minutes to compile on the CI. That's before we start running tests. For example what are some useful things to measure and how? Or what is a repeatable process for refactoring that we can farm it to the entire team including junior engineers that is easy to understand and fool proof? Cheers
    e
    a
    +2
    • 5
    • 13
  • m

    Martmists

    08/18/2025, 12:18 PM
    How do I check if a task exists? I tried
    tasks.named(...).isPresent
    , but it seems tasks.named is throwing an UnknownTaskException instead?
    m
    v
    • 3
    • 24
  • m

    Martmists

    08/18/2025, 12:18 PM
    Also, with project.exec deprecated, is the recommended approach to do
    project.providers.exec { ... }.result.get()
    ?
    m
    v
    r
    • 4
    • 25
  • u

    uday nani

    08/18/2025, 2:44 PM
    Getting this error classpath inside javaexec: classpath Exception in thread "main" io.cucumber.core.gherkin.FeatureParserException:
    v
    • 2
    • 1
  • g

    Gijs Leussink

    08/19/2025, 7:58 AM
    Upgrading from 8.14.3 to 9.0.0, now my Github Actions fail, encountering:
    Copy code
    Class org.gradle.jvm.toolchain.JvmVendorSpec does not have member field 'org.gradle.jvm.toolchain.JvmVendorSpec IBM_SEMERU'
    What am I running into? In
    build.gradle
    I have declared:
    Copy code
    java {
        toolchain {
            languageVersion = JavaLanguageVersion.of(24)
            vendor = JvmVendorSpec.GRAAL_VM
        }
    }
    v
    t
    • 3
    • 4
  • m

    Martmists

    08/19/2025, 7:49 PM
    Is there a flag I can pass to gradle to tell me why a given task is not UP-TO-DATE when it should be?
    i
    • 2
    • 1
  • r

    René

    08/19/2025, 8:09 PM
    you can either use build scans or run with info logging (using -i) which usually logs why its not considered up to date. but be aware gradle logs a lot already with -i
    🧵 2
    m
    v
    • 3
    • 14
  • r

    Rajeesha R

    08/20/2025, 6:20 AM
    I am using gradle8.8 with java21.Passing an option value to custom doclet .like this options.addStringOption('outputdir','output') but when I run the task doclet is giving an error.error: invalid flag: -d 1 error Usage: javadoc [options] [packagenames] [sourcefiles] [@files] Is this a known error? the same works when I execute the doclet from terminal.
    v
    • 2
    • 3
  • p

    Philipp Nowak

    08/21/2025, 9:29 AM
    Hey guys, I recently activated Configuration Cache in my project. Everything works fine, except when executing
    ./gradlew :app:dependencies
    I receive the following exception:
    Copy code
    Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "pool-1-thread-1"
    
    Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "main"
    I am using
    org.gradle.jvmargs=-Xmx10240m
    and also increasing it to 12 GB didn't help. All the other tasks just run fine, e.g. building, testing etc. - the activated configuration cache is on develop for a few days now already. Does anyone have an idea what could cause the OOM on the dependencies task and how to fix it? Deactivating the configuration cache fixes it but should not be an option here 😄
    t
    j
    v
    • 4
    • 95
  • b

    Ben Bader

    08/21/2025, 6:43 PM
    I'm seeing failing CI builds recently, and it seems that Gradle Plugin Portal is hanging up on us. Is there an active incident there right now?
    Copy code
    > Could not resolve com.google.cloud.tools:jib-gradle-plugin:3.4.5.
      Required by:
          settings file 'settings.gradle' > com.google.cloud.tools.jib:com.google.cloud.tools.jib.gradle.plugin:3.4.5
       > Could not resolve com.google.cloud.tools:jib-gradle-plugin:3.4.5.
          > Could not get resource '<https://plugins.gradle.org/m2/com/google/cloud/tools/jib-gradle-plugin/3.4.5/jib-gradle-plugin-3.4.5.pom>'.
             > Could not GET '<https://plugins-artifacts.gradle.org/com.google.cloud.tools/jib-gradle-plugin/3.4.5/760ae3b530620eea5483f15fe876fd30ac44e5dcb7eafca4d63e613ea0d80750/jib-gradle-plugin-3.4.5.pom>'.
                > Remote host terminated the handshake
    c
    • 2
    • 1
  • i

    Ivan CLOVIS Canet

    08/25/2025, 7:16 PM
    The
    Sync
    task deletes all files in the target directory, and then copies the new ones over. Is it possible to configure
    Sync
    (or some other task) to NOT touch the files that haven't changed? I'm using another tool afterwards, which reacts to the files being deleted, even though they are immediately recreated identically.
    v
    • 2
    • 4
  • p

    Philip W

    08/26/2025, 12:25 PM
    How can you sync Gradle with IntelliJ when verifying the signatures? Can you enable verification via a property? Currently I can't sync because IntelliJ tries to download the sources.jar via a detachedConfiguration (added via init script).
    👀 1
    v
    • 2
    • 5
  • a

    Adam

    08/26/2025, 5:00 PM
    tl;dr: Do you have a Gradle build or plugin that would benefit from a fine-grained caching tool? What would you use it for? I've been tinkering with a Kotlin Native project that compiles C code, but DevEx was bad because compilation was really slow, for two main reasons: 1. Any changes to the buildscripts, even if they were unrelated, meant a new build-cache key, which means a long, slow recompile of everything. 2. Build cache was too coarse, and the compile-C task would re-compile everything even if only 1 file out of 1000 changed. Or the changes in the sources were not relevant (like only changing a comment). I kept getting annoyed because any changes in the buildscripts would trigger recompilation of everything, which was really slow. So, I created a custom caching daemon! It supports caching individual operations (e.g. compiling a single file, or creating an archive). The cache key only considers the actual inputs, so it's not sensitive to buildscript changes. Another benefit: the parallelism can be more tightly controlled, no matter how many subprojects/tasks/files there are. It's still messy, but as a POC it's working well in my hobby project. I'm considering splitting it out as a separate library, but before I do I really wanted to get some more information: If I released a per-file caching library as Gradle plugin, how would you use it?
    👀 1
    j
    m
    v
    • 4
    • 94
  • k

    Kelvin Chung

    08/27/2025, 1:35 AM
    Question: Suppose I am applying a plugin that depends on, transitively, a jar that is marked as vulnerable or outdated, How do I replace it with a version that is current? Would I need to apply dependency constraints (or a platform) on the buildscript classpath, or will it suffice to put dependency constraints on, say, a convention plugin that applies that plugin?
    ➕ 1
    m
    v
    t
    • 4
    • 9
  • j

    Jakub Chrzanowski

    08/27/2025, 12:38 PM
    Hi, folks! Quick question: I know about
    Copy code
    aProvider.zip(bProvider) { a, b -> MyData(a, b) } // Provider<MyData>
    but this is fine for merging two providers. What about when I have more of them? Would this be acceptable from the design perspective?
    Copy code
    providerFactory.provider {
        MyData(a.get(), b.get(), c.get(), d.get())
    }
    👏 1
    v
    • 2
    • 5
  • a

    André Martins

    08/27/2025, 3:09 PM
    Hey all, I have a gradle project with multiple submodules and leveraging buildSrc to have common build logic for the multiple submodules. Now I'm trying to run multiple tasks in parallel to speed up my CICD via background processes like
    ./gradlew my-task1 &
    and then grabbing the process ids and wait on them. The thing is I'm getting the following error
    Copy code
    Timeout waiting to lock build logic queue. It is currently in use by another Gradle instance.
    Owner PID: 456
    Our PID: 512
    Owner Operation: 
    Our operation: 
    Lock file: /home/cicd/.gradle/noVersion/buildLogic.lock
    I'm setting
    org.gradle.daemon=false
    in my
    gradle.properties
    file, however I believe this might be related with the buildSrc as it is shared and we might not be able to build it concurrently? Is that it? If so any ideias on how to do such Note: I'm not using
    --parallel
    because im calling same tasks with different values for parameters. Thanks in advance ✌️
    v
    t
    • 3
    • 6
  • j

    Jakub Chrzanowski

    08/28/2025, 9:18 AM
    Hey! Another Providers-related question: I'm adding lazy dependencies to the configuration, like:
    Copy code
    configurations[configurationName].dependencies.addLater(
        myProvider.map { myValue ->
            println("myValue=$myValue")
            return ...
        }
    )
    And yes, this gets printed 20-30 times when the project is being configured. Is that expected, and I shouldn't interfere with that, or is using a cached provider a good choice here?
    v
    • 2
    • 6
  • c

    Christian Beikov

    08/29/2025, 1:59 PM
    Hi all. In Hibernate ORM we're having trouble with compile times, because the incremental compilation is too coarse grained. It looks like this was reported in the past, but unfortunately, there is no link to a GitHub issue where I could track the progress for that. I tried to search for some keywords but couldn't find anything yet. Does anyone of you have an idea if this problem is tracked somewhere?
    a
    v
    s
    • 4
    • 25
  • s

    Sebastian Schuberth

    08/29/2025, 6:05 PM
    I'm having trouble taking the Jackson BOM into use. In
    settings.gradle.kts
    I have
    Copy code
    dependencyResolutionManagement {
        @Suppress("UnstableApiUsage")
        repositories {
            mavenCentral()
        }
    
        versionCatalogs {
            create("libs") {
                from(files("../gradle/libs.versions.toml"))
            }
    
            create("jackson") {
                from("com.fasterxml.jackson:jackson-bom:2.20.0")
            }
        }
    }
    which leads to
    Copy code
    Could not resolve all artifacts for configuration 'incomingCatalogForJackson0'.
    > Could not resolve com.fasterxml.jackson:jackson-bom:2.20.0.
      Required by:
          unknown
       > No matching variant of com.fasterxml.jackson:jackson-bom:2.20.0 was found. The consumer was configured to find attribute 'org.gradle.category' with value 'platform', attribute 'org.gradle.usage' with value 'version-catalog' but:
           - Variant 'compile':
               - Incompatible because this component declares attribute 'org.gradle.category' with value 'library', attribute 'org.gradle.usage' with value 'java-api' and the consumer needed attribute 'org.gradle.category' with value 'platform', attribute 'org.gradle.usage' with value 'version-catalog'
           - Variant 'enforced-platform-compile':
               - Incompatible because this component declares attribute 'org.gradle.category' with value 'enforced-platform', attribute 'org.gradle.usage' with value 'java-api' and the consumer needed attribute 'org.gradle.category' with value 'platform', attribute 'org.gradle.usage' with value 'version-catalog'
    What's wrong with my syntax?
    t
    v
    • 3
    • 10
  • j

    JamesX

    08/30/2025, 1:45 AM
    Hi there. Seeing an issue with composite builds in intellij since upgrading to gradle 8. My project has both a
    buildSrc
    project and an "external" build which creates some gradle plugins. It used to be that I could enable Composite Build in the intellij UI, and then it would resolve my plugin classes back to source when navigating from buildscripts (very nice!) ...but, since upgrading to gradle 8, it seems that my
    buildSrc
    is always listed as a composite, which prevents intellij from showing the option to enable composites (if I enable composites in settings.gradle, the gui option is normally removed, but it also doesn't work properly in IDE). So, does anyone have any ideas or suggests? gpt suggested removing
    buildSrc/settings.gradle
    but that didn't help, and manually printing the included builds shows nothing. I'll attach the xml I pulled from
    .idea/gradle.xml
    in a thread, in case it helps.
    v
    t
    • 3
    • 6
  • t

    Thomas Keller

    09/02/2025, 9:00 AM
    Hello all! When Gradle recompiles build script files during the configuration phase, then this apparently happens single-threaded, as all the other threads are shown as idling. Is there any plan to make this compilation multi-threaded or maybe I'm just missing a flag to enable this? I'm on Gradle 9.1-rc-1.
    v
    j
    t
    • 4
    • 6
1...9899100101102Latest