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

    yjxf vf

    10/17/2025, 2:48 PM
    how to use shadowJar's output as an artifact when using Composite Build. I have two gradle project A and B, B depends A, and use compisite build to reference A, but A use shadow plugin. when i use
    includeBuild('../A') {
    dependencySubstitution {
    substitute module('me.myname:a') using project(':')
    }
    }
    gradle will awayls use jar task's output
    v
    • 2
    • 3
  • d

    Daren Burke

    10/17/2025, 3:22 PM
    trying to add a specific jar to a version catalog that is currently resolved using this notation:
    Copy code
    implementation "com.my-company:my-project:my-version:spec"
    I haven't been able to find a way to declare the ':spec' specific jar within the confines of the version catalog -- any ideas?
    v
    • 2
    • 3
  • k

    Kanstantsin Shautsou

    10/17/2025, 5:38 PM
    I thought something wrong with my code, but then found this in gradle sources. Any idea how to fix this red errors? Is it IDEA bug?
    • 1
    • 1
  • m

    Maksym Moroz

    10/17/2025, 6:00 PM
    In my convention plugins included build I was adding dependencies as
    compileOnly
    (I think my idea was mainly leaving root module
    plugins { }
    as a single source of truth for putting plugins on classpath This approach seemed to work just fine until I decided to lift gcp build cache plugin out of
    settings.gradle.kts
    Now all of the sudden my android library convention plugin fails to resolve classes like com.android.lint How do I make sense of this and what’s the solution? My current intuition is that gcp build cache plugin being applied to settings was maybe putting com.android.library on classpath? Also if I decide to use implementation configuration for convention plugin dependencies does it mean I will need drop root module plugins with apply false and instead have versionless plugins in my build files?
    t
    v
    • 3
    • 5
  • c

    Caleb Cushing

    10/17/2025, 9:34 PM
    A The whole demon jvm thing. Does the Gradle GitHub action support this? Meaning will it cache one that's been downloaded? I'm assuming I would still need to do a setup jvm in GitHub actions though because I imagine that doing that download requires a jvm in the first place. What happens if the required version is something that you already have? And is Gradle support any sort of that version or later? Since the jvm release can now compile for any version?
    m
    • 2
    • 2
  • m

    Maksym Moroz

    10/20/2025, 8:21 AM
    I have seen a few times gradle projects split into api/impl but to date I have never seen a good information on this topic. I am talking about module like feature-something being split into
    feature-something-api
    that is consumed by
    feature-something-impl
    Does anyone have any relevant links?
    v
    • 2
    • 1
  • t

    Tanish

    10/21/2025, 5:39 AM
    How long does it normally take to get our plugin approved, I've been waiting approval for over a week.
    v
    l
    • 3
    • 5
  • k

    Kanstantsin Shautsou

    10/21/2025, 10:28 AM
    gradle 9.1.0 how linux vs macos arm may influence on CC? on mac locally i have no problems (beside isVisible), but on linux it listed all runtime as problems. The only difference i see is java toolchain...
    v
    • 2
    • 33
  • m

    Maksym Moroz

    10/21/2025, 3:55 PM
    I have a list of dependencies that are located in other repos and sometimes that's not what you want when doing some experimentation So far I have been using
    includeBuild()
    to see changes without publishing. However going through the motion of removing version from version catalog and then putting it back seems like a bad way and there is probably a better one. If anyone knows of a better way please share your expertise, thanks
    p
    v
    • 3
    • 4
  • c

    Colton Idle

    10/23/2025, 12:27 AM
    I'm migrating a project to using the modern gradle plugins block to define plugins. Im still using groovy though... not allowed to use kts. it seems like its not allowed to define a variable (like for a kotlin version number). and then reference that in my plugins. is that right? seems crazy to me, but just want a sanity check.
    v
    e
    +2
    • 5
    • 15
  • d

    Daniel Svensson

    10/23/2025, 1:57 PM
    I have a CI job that has a
    build
    job that compiles everything, and then a couple of downstream jobs that does some stuff with the built artifacts. The
    build
    job starts with restoring
    ~/.gradle/shared_cache/modules-2
    and sets the
    GRADLE_RO_DEP_CACHE
    environment variable to this and saves that path to CI cache at the end after having rsync'd any delta. Downstream jobs restore that shared cache and maintains their own cache of
    ~/.gradle/caches/modules-2
    with for example runtime dependencies that aren't available in the shared cache. While this works nice I noticed that it's still pretty slow and with
    --info
    I noticed what it looks like http lookups of manifests for the dependency verification feature. I was under the impression that this would be a no-op given that I have a warm cache with all my dependencies now, so I put that to the test and added
    --offline
    argument to the build and this made the build fail with
    checksum is missing from verification metadata
    . So how do I avoid dependency verification needing network access? If I search my local
    ~/.gradle
    directory for
    .asc
    files, the
    modules-2
    directory is the only one that matches, so these should be available in the cache already. Is this a current limitation that
    GRADLE_RO_DEP_CACHE
    doesn't allow for resolving dependency verification signatures? I'm using a checked-in keyring, and have keyservers disabled in the
    verification-metadata.xml
    with the goal of not needing network access.
    v
    • 2
    • 18
  • e

    Elias Faraclas

    10/23/2025, 8:43 PM
    I'm trying to build my first Android app using Kotlin and Gradle (using Zed editor). Fundamentally, I am unable to make any corrections to my build.gradle.kts file as every time I edit the file, something just reverts it on me. What is going on?
    v
    • 2
    • 4
  • c

    Colton Idle

    10/23/2025, 9:43 PM
    Is there a gradle code search (similar to cs.android.com) ? For example... I'm just trying to find what mavenCentral() and google() actually resolve to in gradle but github search is atrocious.
    e
    v
    • 3
    • 16
  • v

    Vlastimil Brecka

    10/24/2025, 12:12 AM
    Copy code
    subprojects {
        tasks.register("foo") { … }
    }
    ELI5 why does this break configuration avoidance? It's using
    register
    which makes task instantiation lazy.. so what's the problem? Docs basically just say its bad because it injects code not visible at project build file (sure), and it introduces comfiguration time coupling (not sure what does it mean) How exactly am I tanking perf by this?
    c
    v
    • 3
    • 5
  • f

    Fanish

    10/24/2025, 2:10 PM
    There is one pom artifact uploaded by the gardle build publish looks something like this modelVersion4.0.0/modelVersion groupIdc.n.w/groupId artifactIddomain/artifactId version2.6.0.0-SNAPSHOT/version dependencyManagement dependencies dependency groupIdcom.nice.wfm/groupId artifactIdbom/artifactId version2.6.0.0-SNAPSHOT/version typepom/type scopeimport/scope /dependency /dependencies /dependencyManagement dependencies dependency groupIdjakarta.xml.bind/groupId artifactIdjakarta.xml.bind-api/artifactId scopecompile/scope /dependency dependency groupIdc.n.w/groupId artifactIdcommons/artifactId version2.6.0.0-SNAPSHOT/version scopecompile/scope /dependency One project is using the 'domain' dependency when I run dependency tree command in gradle as well as maven (As I am migrating my maven project to gradle) some of it's dependency is not showing in maven dependency tree but showing in gradle dependency tree. for example commons. Why gradle published pom is not working in maven?
    v
    • 2
    • 8
  • b

    Ben Bader

    10/24/2025, 3:52 PM
    👋 While doing a code-review for someone's gradle plugin, I just encountered something I hadn't seem before, and want to know whether there's any basis for my suspicion. Basically, the are registering an extension for their plugin, but instead of using it for configuration, they are using it to expose properties that they then wire up as inputs to other tasks. For example:
    Copy code
    def myExtensionOutput = extensions.getByName("myExtension").outputFilePath
    
    tasks.register("someTask") {
      inputs.file(myExtensionOutput)
    }
    The reason they do this is because the file at the output path is expected to just be there as a result of a previous task execution. There is no implied dependency on the source task in the graph. My question is, is this wrong? Why? It feels wrong to me but I can't think of any actual problem they'd encounter and I'd like to check my assumptions. (clearly the better solution is to pass the path in as a property/env-var/well-known-file, and that's what I've recommended)
    m
    y
    +2
    • 5
    • 16
  • c

    Colton Idle

    10/24/2025, 7:14 PM
    android-ish question, but every dependency defined with
    implementation
    is automatically also available in
    androidTestImplementation
    right? Same goes for unit tests. So you don't have to redefine every dep to be implementation and testImplementation right?
    t
    e
    • 3
    • 6
  • v

    Vlastimil Brecka

    10/24/2025, 7:43 PM
    Is there a way to somehow have groups of projects, and then select which one is active? We currently have a big build with 400 modules (multiple apps). Local dev machines are managing just fine, so I'd like keep is this way - and having ability to build everything in one command is a superpower which I obviously want to keep. But not every team needs such bird's eye view of the whole build, mostly they're working on their part of the codebase. And some voiced that it would be nice if they only saw their part & it's dependency modules, to scope down the complexity Obvioulsy I know I can "hack" it via commenting out the projects in
    settings.gradle
    But isn't there something more sophisticated? Other than flipping it on its head, having per app builds & then one composite one (which I would not prefer)
    👀 1
    v
    a
    • 3
    • 6
  • c

    Colton Idle

    10/26/2025, 5:31 AM
    any resources on how to best use setup-gradle github action? a teammate setup our gradle action and it's realllllly not good. two examples, they're extracting the version number of gradle from our project, instead of just relying on the gradle wrapper... and theyre also pulling in some
    cache
    github action and trying to cache certain downloads from gradle there. i have 0 experience setting up github actions with a gradle+android project (i usually use bitrise) so im unsure if this sort of caching thing is just handled for free when using the official gradle step. thanks!
    e
    p
    +2
    • 5
    • 16
  • r

    Robert Elliot

    10/26/2025, 11:48 AM
    Hi - I need to upgrade from
    com.github.johnrengelman.shadow:8.1.1
    to
    com.gradleup.shadow:9.2.2
    , and it breaks some of my existing gradle config. Details in thread.
    v
    • 2
    • 12
  • c

    Colton Idle

    10/26/2025, 7:57 PM
    Related to my last question. Does anyone know how to run github actions locally with the setup-gradle action? I've been looking at using nektos/act which seems popular as a local github action runner, but it doesn't support setup-gradle v4 or v5 (it does seem to work fine with v3 tho). Just wanna see if theres something the gradle community uses already
    e
    • 2
    • 3
  • p

    Philipp Nowak

    10/27/2025, 7:34 AM
    I try to upgrade our Android project to Gradle 9.1 and came across this issue: https://github.com/gradle/gradle/issues/33619 - all unit tests fail. The suggested workarounds, i.e.
    isIncludeAndroidResources = false
    and
    failOnNoDiscoveredTests = false
    do not seem to work, I still get the same error
    Copy code
    There are test sources present and no filters are applied, but the test task did not discover any tests to execute. This is likely due to a misconfiguration. Please check your test configuration. If this is not a misconfiguration, this error can be disabled by setting the 'failOnNoDiscoveredTests' property to false.
    Upgrading AGP to an alpha 9.x is no option for us atm. Did anyone solve this problem?
    ✅ 1
    v
    • 2
    • 6
  • r

    Rahul Srivastava

    10/27/2025, 7:57 AM
    hello team i am trying to build thingsboard iot oppen source code but getting error related to gradle
    Copy code
    [ERROR] Failed to execute goal org.thingsboard:gradle-maven-plugin:1.0.12:invoke (default) on project edqs: org.gradle.tooling.BuildException: Could not execute build using connection to Gradle distribution '<https://services.gradle.org/distributions/gradle-7.3.3-bin.zip>'. -> [Help 1]
    while looking deeper in the issue i got that it is not able to build the gradle.build file my gradle.buuld file looks like this
    Copy code
    /**
     * Copyright © 2016-2025 The Thingsboard Authors
     *
     * Licensed under the Apache License, Version 2.0 (the "License");
     * you may not use this file except in compliance with the License.
     * You may obtain a copy of the License at
     *
     *     <http://www.apache.org/licenses/LICENSE-2.0>
     *
     * Unless required by applicable law or agreed to in writing, software
     * distributed under the License is distributed on an "AS IS" BASIS,
     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     * See the License for the specific language governing permissions and
     * limitations under the License.
     */
    import org.apache.tools.ant.filters.ReplaceTokens
    
    plugins {
        id "nebula.ospackage" version "8.6.3"
    }
    
    buildDir = projectBuildDir
    version = projectVersion
    distsDirName = "./"
    
    // OS Package plugin configuration
    ospackage {
        packageName = pkgName
        version = "${project.version}"
        release = 1
        os = LINUX
        type = BINARY
    
        into pkgInstallFolder
    
        user pkgUser
        permissionGroup pkgUser
    
        // Copy the actual .jar file
        from(mainJar) {
            // Strip the version from the jar filename
            rename { String fileName ->
                "${pkgName}.jar"
            }
            fileMode 0500
            into "bin"
        }
    
        if("${pkgCopyInstallScripts}".equalsIgnoreCase("true")) {
            // Copy the install files
            from("${buildDir}/bin/install/install.sh") {
                fileMode 0775
                into "bin/install"
            }
    
            from("${buildDir}/bin/install/upgrade.sh") {
                fileMode 0775
                into "bin/install"
            }
    
            from("${buildDir}/bin/install/logback.xml") {
                into "bin/install"
            }
        }
    
        // Copy the config files
        from("${buildDir}/conf") {
            exclude "${pkgName}.conf"
            fileType CONFIG | NOREPLACE
            fileMode 0754
            into "conf"
        }
    
        // Copy the data files
        from("${buildDir}/data") {
            fileType CONFIG | NOREPLACE
            fileMode 0754
            into "data"
        }
    
        // Copy the extensions files
        from("${buildDir}/extensions") {
            into "extensions"
        }
    }
    
    // Configure our RPM build task
    buildRpm {
    
        arch = NOARCH
    
        archiveVersion = projectVersion.replace('-', '')
        archiveFileName = "${pkgName}.rpm"
    
        requires("(java-17 or java-17-headless or jre-17 or jre-17-headless)") // .or() notation does work in RPM plugin
    
        from("${buildDir}/conf") {
            include "${pkgName}.conf"
            filter(ReplaceTokens, tokens: ['pkg.platform': 'rpm'])
            fileType CONFIG | NOREPLACE
            fileMode 0754
            into "${pkgInstallFolder}/conf"
        }
    
        preInstall file("${buildDir}/control/rpm/preinst")
        postInstall file("${buildDir}/control/rpm/postinst")
        preUninstall file("${buildDir}/control/rpm/prerm")
        postUninstall file("${buildDir}/control/rpm/postrm")
    
        user pkgUser
        permissionGroup pkgUser
    
        // Copy the system unit files
        from("${buildDir}/control/template.service") {
            addParentDirs = false
            fileMode 0644
            into "/usr/lib/systemd/system"
            rename { String filename ->
                "${pkgName}.service"
            }
        }
    
        link("${pkgInstallFolder}/bin/${pkgName}.yml", "${pkgInstallFolder}/conf/${pkgName}.yml")
        link("/etc/${pkgName}/conf", "${pkgInstallFolder}/conf")
    }
    
    // Same as the buildRpm task
    buildDeb {
    
        arch = "all"
    
        archiveFileName = "${pkgName}.deb"
    
        requires("openjdk-17-jre").or("java17-runtime").or("oracle-java17-installer").or("openjdk-17-jre-headless")
    
        from("${buildDir}/conf") {
            include "${pkgName}.conf"
            filter(ReplaceTokens, tokens: ['pkg.platform': 'deb'])
            fileType CONFIG | NOREPLACE
            fileMode 0754
            into "${pkgInstallFolder}/conf"
        }
    
        configurationFile("${pkgInstallFolder}/conf/${pkgName}.conf")
        configurationFile("${pkgInstallFolder}/conf/${pkgName}.yml")
        configurationFile("${pkgInstallFolder}/conf/logback.xml")
        configurationFile("${pkgInstallFolder}/conf/actor-system.conf")
    
        preInstall file("${buildDir}/control/deb/preinst")
        postInstall file("${buildDir}/control/deb/postinst")
        preUninstall file("${buildDir}/control/deb/prerm")
        postUninstall file("${buildDir}/control/deb/postrm")
    
        user pkgUser
        permissionGroup pkgUser
    
        // Copy the system unit files
        from("${buildDir}/control/template.service") {
            addParentDirs = false
            fileMode 0644
            into "/lib/systemd/system"
            rename { String filename ->
                "${pkgName}.service"
            }
        }
    
        link("${pkgInstallFolder}/bin/${pkgName}.yml", "${pkgInstallFolder}/conf/${pkgName}.yml")
        link("/etc/${pkgName}/conf", "${pkgInstallFolder}/conf")
    }
  • r

    Rahul Srivastava

    10/27/2025, 7:58 AM
    i am using mac jdk 17.0.17
    🧵 1
    v
    • 2
    • 1
  • p

    Philip W

    10/27/2025, 12:51 PM
    Is there any builtin-easy way to call a TransformAction directly? I want to download a yaml file from a url and I need to transform it into a json file. Of course I could setup a fake repo, add all the attributes, but it there any simple way to call a TransformationAction with an already downloaded file? Or do I really need to use a custom task?
    v
    • 2
    • 1
  • a

    Andy Damevin

    10/28/2025, 9:02 AM
    Hello, I have been trying to allow running Deno (Light node)/Esbuild and other native binaries as a Maven/Gradle Java library. Allowing arch specific dependencies already works fine in Maven and in NPM ecosystems and I thought it would also work on Gradle as documented (doc about variants). But it didn't work at all, when debugging I can see it's using the module file but it's not checking the arch native stuff at all. I must be missing something. I found a few related issue (such as https://github.com/gradle/gradle/issues/34845), but didn't find a solution to my issue yet.
    v
    • 2
    • 42
  • a

    Albert ten Napel

    10/28/2025, 2:12 PM
    Hello, I have a "compile" task that contains the following code:
    Copy code
    source = fileTree("$projectDir").matching {
        include("$javaSourceDirName/**/*.java")
        excludedJavaFiles.forEach { exclude(it) }
    }
    This results in many errors such as:
    Copy code
    Cannot infer source root(s) for source `file 'C:\...\Blabla.java'`. Supported types are `File` (directories only), `DirectoryTree` and `SourceDirectorySet`.
    This seems to disable incremental compilation. How can I fix this code snippet?
    ✅ 1
    v
    • 2
    • 7
  • z

    Zeynep Ozdemir

    10/28/2025, 10:25 PM
    Windows PowerShell Copyright (C) Microsoft Corporation. All rights reserved. Install the latest PowerShell for new features and improvements! https://aka.ms/PSWindows PS C:\cprg303\cprg303LabAssignments> npx react-native run-android info A dev server is already running for this project on port 8081. info Installing the app... [Incubating] Problems report is available at: file///C/cprg303/cprg303LabAssignments/android/build/reports/problems/problems-report.html Deprecated Gradle features were used in this build, making it incompatible with Gradle 10. You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins. For more on this, please refer to https://docs.gradle.org/9.0.0/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation. 10 actionable tasks: 10 up-to-date info 💡 Tip: Make sure that you have set up your development environment correctly, by running npx react-native doctor. To read more about doctor command visit: https://github.com/react-native-community/cli/blob/main/packages/cli-doctor/README.md#doctor FAILURE: Build failed with an exception. * Where: Build file 'C:\cprg303\cprg303LabAssignments\android\build.gradle' line: 21 * What went wrong: A problem occurred evaluating root project 'cprg303LabAssignments'.
    Failed to apply plugin 'com.facebook.react.rootproject'.
    > A problem occurred configuring project ':app'. > [CXX1101] NDK at C:\Users\zeyne\AppData\Local\Android\Sdk\ndk\27.1.12297006 did not have a source.properties file * 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 2s error Failed to install the app. Command failed with exit code 1: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081 FAILURE: Build failed with an exception. * Where: Bui ld file 'C:\cprg303\cprg303LabAssignments\android\build.gradle' line: 21 * What went wrong: A problem occurred evaluating root project 'cprg303LabAssignments'. > Failed to apply pl ugin 'com.facebook.react.rootproject'. > A problem occurred configuring project ':app'. > [CXX1101] NDK at C:\Users\zeyne\AppData\Local\Android\Sdk\ndk\27.1.12297006 did not have a source.properties file * 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 2s. info Run CLI with --verbose flag for more details. hi how can I fix this build error I have a lab due on friday and having diffuculties
    🧵 2
    v
    • 2
    • 3
  • c

    Caleb Cushing

    10/29/2025, 1:19 AM
    so the whole daemon-jvm thing doesn't work out of the box?
    Copy code
    ./gradlew updateDaemonJvm --jvm-version=21
    Copy code
    Configuration cache state could not be cached: field `__toolchainDownloadUrls__` of task `:updateDaemonJvm` of type `org.gradle.buildconfiguration.tasks.UpdateDaemonJvm`: error writing value of type 'org.gradle.api.internal.provider.DefaultMapProperty'
    😢 3
    v
    • 2
    • 33
  • c

    Colton Idle

    10/29/2025, 9:31 PM
    Trying to sanity check that I understand the gradle lingo here A precompiled script plugin can be a convention plugin. so all convention plugins are precompiled script plugin but not all precompiled script plugin are convention plugins. A precompiled script plugin goes into 1 of 2 spots • dedicated
    buildSrc
    directory in your build • separate included build (can be named
    build-logic
    for example but an included build is also == composite build
    m
    e
    e
    • 4
    • 33