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

    Adam

    11/16/2025, 12:40 PM
    Is there a util for converting a Gradle .module metadata file into a POM.xml? It doesn't have to be rigorous, I want to experiment with something.
    v
    m
    • 3
    • 3
  • v

    Vlastimil Brecka

    11/16/2025, 11:39 PM
    I have a multi app build, and I want to run a givem task over all of the apps. Which of these is the preferred way? A) to declare a task in root project, which explicistly lists them
    Copy code
    // Root
    tasks.register("lintAllDebug") {
        group = "verification"
        dependsOn(
                ":foo:app:lintAllDebug",
                ":bar:app:lintAllDebug",
                ":quax:app:lintAllDebug"
        )
    }
    B) rely on the same named-ness and just
    ./gradlew lintAllDebug
    v
    • 2
    • 142
  • c

    Colton Idle

    11/17/2025, 7:43 AM
    In a build file does it matter where
    apply plugin
    is called? I have an android app module build file that I'm migrating to kts and I noticed that we have
    apply plugin: "com.google.gms.google-services
    line at the bottom of the build file. Now I'm wondering if theres any reason why it would be at the bottom vs the 10 plugins at the top of the file. seems like someone in the past made a concious decision to put it at the bottom?
    v
    • 2
    • 3
  • n

    Niels Doucet

    11/17/2025, 1:38 PM
    I have a
    copySpec
    that only defines exclusions (with
    exclude
    ) and I'd like to reuse it in multiple tasks that have differing from clauses. Is there a way to do so? (more details in 🧡 )
    βœ… 1
    v
    • 2
    • 5
  • s

    Sebastian Schuberth

    11/18/2025, 10:37 AM
    If I define a custom version catalog from an artifact in my root
    settings.gradle.kts
    file like
    Copy code
    dependencyResolutionManagement {
        versionCatalogs {
            create("ortLibs") {
                from("org.ossreviewtoolkit:version-catalog:71.4.0")
            }
        }
    }
    then what's the correct syntax to depend on an artifacts form that catalog in my project's convention plugins hosted in
    buildSrc
    ?
    n
    v
    • 3
    • 13
  • m

    Martmists

    11/18/2025, 9:59 PM
    I have a
    buildSrc
    folder and
    my-plugin
    , the latter being included with includeBuild. I have a
    common.gradle.kts
    in my buildSrc, but if I try to add
    plugins { id("my-plugin-id") }
    , I get
    Plugin [id: 'my-plugin-id'] was not found in any of the following sources:
    How do I fix this? I tried merging my-plugin with it, but because the plugin depends on kapt and kotlin-compiler-embeddable and such it ended up giving all sorts of gradle/kotlin errors. I also couldn't do
    implementation(project("../my-plugin"))
    it seems.
    v
    • 2
    • 9
  • e

    Eli Graber

    11/18/2025, 10:00 PM
    I saw this post about type-safe project accessors which says they cause an issue with Kotlin IC. Is there an issue tracking this (if there is any plan to address it at all)?
    v
    m
    t
    • 4
    • 5
  • s

    SettingDust

    11/19/2025, 10:45 AM
    Why is my task failing with
    Cannot fingerprint input property 'classpaths.$3.$7.id': value 'xyz.bluspring:AsmFabricLoader:1.3.3-SNAPSHOT:20251024.135151-1' cannot be serialized.
    Don't know how to serialize an object of type org.gradle.api.internal.artifacts.repositories.resolver.MavenUniqueSnapshotComponentIdentifier.
    How to fix it in plugin? https://github.com/terrarium-earth/jvm-multiplatform/blob/main/classpath-api-stubs/src/main/kotlin/net/msrandom/stubs/GenerateStubApi.kt#L25 https://gradle.com/s/vlkllhuaeyuc2
    v
    • 2
    • 1
  • k

    Krysia Michulka

    11/19/2025, 12:44 PM
    i am a hs student and this is my first experience with this stuff. My project requires me to make something so i decided to try and make a planner app. I decided to use react native. Setting up seemed to be going alright till i tried running npx react-native run-android. It keeps telling me this: FAILURE: Build failed with an exception. * What went wrong: Gradle requires JVM 17 or later to run. Your build is currently configured to use JVM 11.
  • k

    Krysia Michulka

    11/19/2025, 12:44 PM
    how do i fix this?
    🧡 1
    v
    • 2
    • 1
  • c

    Colton Idle

    11/19/2025, 4:32 PM
    So I have an interesting issue. I have an android app, and an android library (included via git submodules). The project won't build because the android library/git submodule wont compile because it can't find the toml that's used in the android library/git submodule. If I add a line in my settings.gradle.kts for
    versionCatalogs { create("lib") { from(mysubmoduledir/the.toml )}}
    then it builds (hooray), but then if I try to add a toml in my actual projects gradle folder then I get an error "You can only call the 'from' method a single time." Ideas?
    v
    t
    • 3
    • 74
  • m

    Miha Markic

    11/20/2025, 10:57 AM
    here is my task: I want to generated set keystore password within a gradle task. Is this possible?
  • m

    Miha Markic

    11/20/2025, 10:59 AM
    a silly solution could to write credentials to a file and make signingConfig read from that file
    🧡 1
  • m

    Miha Markic

    11/20/2025, 11:00 AM
    but I'd rather avoid dumping it to a file
    🧡 1
    v
    t
    • 3
    • 26
  • g

    Gabor Torok

    11/20/2025, 4:30 PM
    Hi, as i am trying to understand how the
    runtimeClasspath
    works, i found something weird. we are on
    8.11.1
    , and running this task on different projects yield weird results:
    Copy code
    tasks.register('printMyTestClasspath') {
        dependsOn 'testClasses'
    
        doLast {
            def classpathUrls = sourceSets.test.runtimeClasspath.files
            classpathUrls.each {
                if (!it.toString().contains(".gradle")) { // to exclude external dependencies
                    println "classpath file: $it"
                }
            }
        }
    }
    we have a setup where we have multiple builds depending on each other via
    includeBuild
    . what's weird is that using the above task in show inconsistent results: β€’ sometime the
    main
    class directory is in there (
    build/classes/java/main
    ) and sometime the jar file is in there (
    build/libs/something-1.0.jar
    ) β€’ similarly, this is the same for the included builds - i sometimes see the
    classes/java/main
    of the dependency project, and sometimes i see the
    jar
    β€’ on repeated executions the results seem to stay the same. My questions are: β€’ What could cause this? The
    build.gradle
    files are very similar in our different builds, i did not find any indication of what could cause this difference (sure, i could be missing something.) β€’ Is this a bug? Or something that has been fixed in later versions? β€’ Are there any workarounds that I can use to get some consistency? I want to write tooling that loads the test classes with the class loader, and then checks stuff on them - but i am getting random errors, based on weather some projects classpath has the
    jar
    or the
    classes
    ...
    c
    v
    • 3
    • 15
  • w

    William Chong

    11/20/2025, 9:19 PM
    Hi I'm trying to make a minecraft mod by my own very first time and I've met an issue while trying to run ./gradlew.bat build .\gradlew.bat : At line:1 char:1 + .\gradlew.bat build > build_output.txt 2>&1 + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:String) [], RemoteException + FullyQualifiedErrorId : NativeCommandError FAILURE: Build failed with an exception. * What went wrong: A problem occurred configuring root project 'RealRender'.
    Could not resolve all artifacts for configuration 'classpath'.
    > Could not find net.fabricmcfabric loom1.7.6. Searched in the following locations: - https://maven.fabricmc.net/net/fabricmc/fabric-loom/1.7.6/fabric-loom-1.7.6.pom - https://repo.maven.apache.org/maven2/net/fabricmc/fabric-loom/1.7.6/fab ric-loom-1.7.6.pom - https://plugins.gradle.org/m2/net/fabricmc/fabric-loom/1.7.6/fabric-loo m-1.7.6.pom Required by: buildscript of root project 'RealRender' * Try:
    Run with --stacktrace option to get the stack trace.
    Run with --info or --debug option to get more log output.
    Run with --scan to generate a Build Scan (Powered by Develocity).
    Get more help at https://help.gradle.org.
    BUILD FAILED in 6s and I tried using other version of gradle and it doesnt help I’m sorry for taking up your valuable time I know it might be a easy issue for you guys to solve. Thank you for your patience and guidance
    c
    v
    • 3
    • 6
  • m

    Miha Markic

    11/21/2025, 9:28 AM
    Is there a way to run a gradle task always when all the tasks finish? (to clean up) I'm thinking android studio but this is most probably generic question for gradle. If not, I'll ask in android channel.
    m
    a
    • 3
    • 15
  • c

    Colton Idle

    11/21/2025, 6:03 PM
    Are there any "popular" or big name library authors that self host their artifacts? (basically. not on maven central?) I'm trying to possibly self host (for reasons) and trying to see what the "industry standard" is in terms of hosting the artifacts, but also how the documentation states the inclusion of the artifact repository.
    e
    j
    +3
    • 6
    • 22
  • a

    Adam

    11/22/2025, 11:14 AM
    Do the checksums in the Gradle Module Metadata file get used for anything? I read this issue, which I think implies Gradle doesn't use them at all.
    πŸ‘€ 2
    l
    • 2
    • 2
  • c

    Colton Idle

    11/22/2025, 6:49 PM
    What steps does maven take to search for artifact files. For example, it seems like it searches for a module file, then pom, then jar or aar? My quesiton stems from the fact that I've noticed that a lot of 3rd party artifact repository don't present you with an html tree to browse, so it looks like it's a guess and check sort of system.
    πŸ‘€ 2
    e
    • 2
    • 3
  • Π½

    Николай КлСбан

    11/23/2025, 10:12 AM
    Is there any difference between kt or kts file format for convention plugins in includeBuild project?
    πŸ‘€ 1
    m
    l
    • 3
    • 7
  • j

    Javi

    11/24/2025, 9:37 AM
    Hello πŸ‘‹ Which is the way to get all dependencies, direct and transitive ones in a module? I tried with no luck by getting the
    implementation
    configuration and looking for the dependencies there.
    m
    v
    l
    • 4
    • 77
  • e

    Eli Graber

    11/24/2025, 8:15 PM
    Is there any way to tell Gradle to pin worker threads to only use CPU performance cores (I'm using an i9 12900k)? I'm curious if the faster throughput will offset the lower parallelism enough to make it worth it. I have some tasks that use 100% of all CPU cores, and I sometimes like to do other things while building (which should be fine using the efficiency cores).
    πŸ‘€ 1
    l
    m
    +2
    • 5
    • 11
  • Π½

    Николай КлСбан

    11/25/2025, 9:18 AM
    Is there any way inside build.gradle.kts to define some variable that will be accessible right away by plugins applied in
    plugins {}
    block.
    m
    e
    l
    • 4
    • 18
  • m

    maikelvdh

    11/25/2025, 12:00 PM
    Is it possible to define the mapping from the maven coordinates to project name as part of the
    includeBuild()
    context? this to keep the mapping from module to project at its origin
    l
    v
    • 3
    • 7
  • c

    Colton Idle

    11/26/2025, 2:43 AM
    I've got an android app module's build.gradle file that is using a modern plugin block with alias' for everything EXCEPT for
    id("org.jetbrains.kotlin.plugin.parcelize")
    . I converted it to an entry in my toml, and converted it to
    alias(libs.plugins.kotlin.parcelize)
    in my build file. but now it wont build UNLESS I go to root build.gradle and add ``alias(libs.plugins.kotlin.parcelize) apply false` ` Why is that needed when using version catalog... but when I just used
    id("org.jetbrains.kotlin.plugin.parcelize")
    it did not need the extra line in my root build.gradle (bonus points: how did it even work with id if I never declared the version of the plugin I wanted until i now had to add it in version catalog declaration)
    e
    e
    • 3
    • 8
  • s

    Sachin HR

    11/26/2025, 3:06 PM
    I am trying to upgrade spring boot from 3.3.13 to 3.5.7. Using gradle Gradle 4.8. Getting this error A problem occurred configuring root project 'test-project. > java.util.concurrent.ExecutionException: org.gradle.api.GradleException: Failed to create Jar file /Users/sachinhr/.gradle/caches/jars-9/b622d58fb9140b4bb070fced1ad683db/spring-core-6.2.12.jar. > Tried deleting gradle cache and rebuilding. Still gives same error
    c
    v
    • 3
    • 2
  • m

    Matei David

    11/26/2025, 10:20 PM
    I'm looking to better isolate the Gradle user home in tests. Say I work on a Gradle plugin, and I want to test it with TestKit. I want the test to be reliable in CICD, so I don't want it to be polluted with my real
    ~/.gradle
    . What I currently do is to populate
    build/gradle
    with what I need, namely
    gradle.properties
    , some
    init.d/
    scripts, and I point TestKit there with
    withTestKitDir()
    . This is mostly ok, except that the various Gradle distributions are downloaded in such test user home directories. This is annoying because it's slow the first time around, and also because these directories are not getting cleaned up. E.g. in 1 project after playing with only 9.2.0 and 9.2.1, I have almost 2GB of mostly generated Gradle jars and transforms. Is there a way to improve this? So basically, I don't care to isolate the Gradle artifacts and transforms from my primary Gradle user home, but I definitely want my user home properties and init scripts not to be visible in tests. Is there some way to achieve properties/init script isolation while also avoiding cache duplication?
    t
    a
    • 3
    • 4
  • g

    Gabor Torok

    11/27/2025, 6:00 PM
    Hi, we have a bunch of composite builds in our repository, and want to set up the gradle cache to make them faster. when we run our PR checks, each project runs the same build cache setup logic. since establishing the environment where we run (is it on CI? is it on desktop? is it in a docker container? which branch is it? etc.. ) can take some time, i am looking into options on how to just do just once, and not run those checks for every project... now it seems that i can calculate what i need, and store it with
    System.setProperty
    - and if i do, every other project can just check if the property is set, and if it is, use it, and not do the calculations. this actually works, the checks run only once, yay. however this solution feels a bit hacky, as it is kind of circumventing gradle to pass along the information. the question is, are there some alternatives that are better for this use case? we are currently using
    8.11.1
    - is this solution still going to be viable in later releases?
  • c

    Caleb Cushing

    11/28/2025, 10:48 PM
    I am confused about publishing version catalogs. The preliminary example given has. I am kind of assuming that we only need to use the
    catalog {...]
    for publishing one?
    Copy code
    catalog {
        // declare the aliases, bundles and versions in this block
        versionCatalog {
            library("my-lib", "com.mycompany:mylib:1.2")
        }
    }
    but then says we "The catalog must be created programmatically, see Programming catalogs for details." which uses the format
    Copy code
    dependencyResolutionManagement {
        versionCatalogs {
            create("libs") {
                version("groovy", "3.0.5")
                version("checkstyle", "8.37")
                library("groovy-core", "org.codehaus.groovy", "groovy").versionRef("groovy")
                library("groovy-json", "org.codehaus.groovy", "groovy-json").versionRef("groovy")
                library("groovy-nio", "org.codehaus.groovy", "groovy-nio").versionRef("groovy")
                library("commons-lang3", "org.apache.commons", "commons-lang3").version {
                    strictly("[3.8, 4.0[")
                    prefer("3.9")
                }
            }
        }
    }
    p
    • 2
    • 2