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

    Philip W

    10/30/2025, 6:33 AM
    How does the tooling api work in detail? Does it reuse the Gradle daemon or the host JVM? And what Gradle version will be used? The one specified in the Wrapper?
    👀 1
    s
    v
    • 3
    • 12
  • c

    Caleb Cushing

    10/30/2025, 1:07 PM
    only happening since 9.2, the weird thing is it's not happening locally although I got an even weirder first run error locally. It might be related
    Copy code
    java.lang.IllegalArgumentException: Cannot have abstract method FileSystemLocationProperty.getAsFile(): Provider<File>.
    full stack/repo https://github.com/xenoterracide/gradle-semver/actions/runs/18941346345/job/54080662841?pr=494#step:5:437
    Untitled.java
    m
    v
    • 3
    • 99
  • c

    Colton Idle

    10/30/2025, 1:40 PM
    I'm slowly converting a bunch of files from groovy to kts. One thing that has a bunch of conflicting information about it seemingly is how to take values from gradle.properties and reference them in a kts file. For example... in our settings.gradle we have some maven repositories declared that require a username and password. When I convert to settings.gradle.kts I can't reference those variables directly anymore. Can anyone confirm what the right way to reference a prop in gradle.properties (either in the project or global)? Essentially now I have
    Copy code
    awsRepoUrl=<https://1234567890.d.codeartifact.us-east-1.amazonaws.com/maven/my-repo/>
    awsUsername=aws
    awsPassword=eyJ0eXAiOiJKV1QiLCJh...
    and
    Copy code
    maven {
      url = uri(awsRepoUrl)
      credentials {
        username = awsUsername
        password = awsPassword
      }
    }
    n
    e
    v
    • 4
    • 10
  • c

    Chris Lee

    10/31/2025, 12:40 AM
    Bitten by the default permissions / reproducible archive changes in Gradle 9 -
    distZip
    no longer pulls the filesystem permissions. We could force that via
    useFileSystemPermissions
    but seems cleaner to set the explicit/desired permissions in the build script. But doing that seems to be incompatible with the configuration cache. Seems like
    filePermissions
    is incompatible with configuration cache?
    Copy code
    plugins {
        application
    }
    
    tasks.named<Zip>("distZip") {
        // setting permissions here fails as properties are finalized already
    //    filesMatching("**/*") {
    //        filePermissions {
    //            unix("rwxr-xr-x")
    //        }
    //    }
    }
    
    distributions {
        main {
            contents {
                filesMatching("bin/**") {
                    // simply adding "filePermissions" fails
                    // Cause: class org.gradle.api.internal.file.copy.DefaultCopySpec cannot be cast to class org.gradle.api.file.FileCollection (org.gradle.api.internal.file.copy.DefaultCopySpec and org.gradle.api.file.FileCollection are in unnamed module of loader org.gradle.internal.classloader.VisitableURLClassLoader @3043fe0e)
                    filePermissions {
                        unix("rwxr-xr-x")
                    }
                }
            }
        }
    }
    v
    • 2
    • 8
  • m

    Maksym Moroz

    10/31/2025, 2:20 PM
    Copy code
    Calculating task graph as configuration cache cannot be reused because init script '../../../../private/var/folders/32/33qr05gj24jbrq7qvg4c1fjh0000gn/T/ijJvmDebugger1.gradle' has changed.
    Any idea what might be causing this to happen from time to time?
    v
    v
    • 3
    • 4
  • b

    Bob Ham

    10/31/2025, 2:40 PM
    How do I extend an existing task with my own bits? I've tried
    originalTask.dependsOn myBits; myBits.shouldRunAfter originalTask
    but
    myBits
    still runs before
    originalTask
  • b

    Bob Ham

    10/31/2025, 2:44 PM
    I tried using
    task.named
    to create my bits but I get an error:
    The task '...' (org....Task) is not a subclass of the given type
    🧵 1
    v
    n
    • 3
    • 69
  • b

    Bob Ham

    10/31/2025, 3:39 PM
    I'm trying to use the spdx-gradle-plugin but I'm getting an error trying to extend it. Here's the relevant snippet:
    Copy code
    spdxSbom {
        targets {
            create("release") {
                configurations.set(["projectCustReleaseRuntimeClasspath"])
            }
        }
    }
    
    python.pip 'spdx_tools:0.8.3'
    
    tasks.register("convertSpdxRelease", PythonTask) {
        ...
    }
    spdxSbomForRelease.finalizedBy convertSpdxRelease
    convertSpdxRelease.dependsOn spdxSbomForRelease
    and here is the error:
    Copy code
    * What went wrong:
    A problem occurred evaluating root project 'CustKeyboard_Studio'.
    > Could not create task ':spdxSbomForRelease'.
       > Configuration with name 'projectCustReleaseRuntimeClasspath' not found.
    The task works fine if I comment out the
    configurations.set(...
    or if I comment out both the
    finalizedBy
    and
    dependsOn
    statements. Anyone have a clue as to why that might be?
    n
    v
    • 3
    • 18
  • a

    Anish Sandeep Bhargav

    10/31/2025, 8:50 PM
    Hi, I Was Making My Minecraft Mod I Don't Really Have That Great Knowledge About These Programming Languages So I Had Generated The Code From AI And I Am Getting These Errors I Have Checked My All Files Codes And I Have Know Errors But While Using ./gradlew build, ./gradlew runClient I See This Error
    v
    • 2
    • 1
  • н

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

    11/03/2025, 7:26 PM
    Can someone help me understand why two Gradle daemons are being spawned when I run for i.e. “Clean Project” in Android Studio in a project with
    build-tools
    as includedBuild? I’ve configured the AS to use the Gradle wrapper (version 8.14.3), but for some reason, another daemon starts up using the 9.0-milestone-1 distribution.
    • 1
    • 1
  • m

    Mike Wacker

    11/03/2025, 10:35 PM
    Is there a way to express a task dependency of the form: "only run if the dependent task is out-to-date"? I.e., I want to run the
    composeUp
    task for the
    avast.gradle.docker-compose
    to run first if the
    test
    task is out-of-date, but it (and the
    composeDown
    task) should abe skipped if the
    test
    task is skipped. Context: https://github.com/avast/gradle-docker-compose-plugin/issues/453
    v
    a
    • 3
    • 11
  • a

    Andy Damevin

    11/05/2025, 7:20 PM
    Hello! For some obscure reason, Gradle is not using my .module file by default but the pom instead: https://repo1.maven.org/maven2/io/mvnpm/esbuild-java/2.0.0-beta-2/ If I set this it works:
    Copy code
    mavenCentral()  {
            metadataSources {
                gradleMetadata()
                mavenPom()
            }
        }
    the weird thing is that for other repos such as guava or junit, it does look for the .module file in central even without this conf. I might be missing something..
    Copy code
    2025-11-05T20:17:32.455+0100 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationRunner] Completing Build operation 'Metadata of <https://repo.maven.apache.org/maven2/io/mvnpm/esbuild-java-native-deps/2.0.0-beta-2/esbuild-java-native-deps-2.0.0-beta-2.pom>'
    2025-11-05T20:17:32.456+0100 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationRunner] Build operation 'Metadata of <https://repo.maven.apache.org/maven2/io/mvnpm/esbuild-java-native-deps/2.0.0-beta-2/esbuild-java-native-deps-2.0.0-beta-2.pom>' completed
    
    ...
    
    2025-11-05T20:17:32.308+0100 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationRunner] Completing Build operation 'Metadata of <https://repo.maven.apache.org/maven2/com/google/guava/guava/33.5.0-jre/guava-33.5.0-jre.module>'
    2025-11-05T20:17:32.308+0100 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationRunner] Build operation 'Metadata of <https://repo.maven.apache.org/maven2/com/google/guava/guava/33.5.0-jre/guava-33.5.0-jre.module>' completed
    t
    j
    +4
    • 7
    • 67
  • v

    valluru saiteja

    11/09/2025, 10:22 AM
    Hello Team, I was running sonarscan for gradle related projects, that was multi-project... So inside app folder there will be multiple modules . in the root level we have one build,gradle and settings.gradle . Have implemented sonar plugin and properties in the build.gradle file.
    Copy code
    plugins {
        // Declare the SonarQube plugin here but don't apply it automatically.
        // This makes the plugin available to all subprojects using the same version,
        // while allowing us to selectively apply it only to relevant modules (e.g., exclude 'bom' or root).
        id 'org.sonarqube' version '7.0.1.6134' apply false
    }
    
    subprojects {
        if (project.name != 'bom') {
            apply plugin: 'java-library'
            apply plugin: 'maven-publish'
            apply plugin: 'jacoco'
            apply plugin: 'org.sonarqube'
    
            afterEvaluate {
                if (project.name == "sai" || project.name == "sai1" || project.name == "sai2") {
                    // Skip SonarQube analysis for these projects
                    sonar {
                        skipProject = true
                    }
                } else {
                    // Apply SonarQube properties for other projects
                    sonar {
                        properties {
                            property "sonar.host.url", "<https://sonar.sai.com>"
                            property "sonar.projectKey", "sai.eas.app-gradle"
                            property "sonar.projectName", "sai-eas.app-gradle"
                            property "sonar.token", "sai_faefefibbvkbrkbrbkbbvrkb123456"
                            property "sonar.sources", "src/main/java"
                            property "sonar.tests", "src/test/java"
                            // Add other required properties here
                        }
                    }
                }
            }
        }
    }
    
    While running in local at first it analyzed and publish the reports to sonarqube server(Not for all componenets just 1 or 2 ). inside modules there will be submodules. If a particular module doesn't contain say for example src/tst/java the sonarscan should skip and go for next module ...in my case it was failing right after that stage. I was using the command "gradle sonar --info"
    v
    • 2
    • 1
  • i

    Igor Mukhin

    11/10/2025, 11:00 AM
    Strange thing started happening today to my project build. The project build started failing today, because it is selecting very old version of the dependency `commons-iocommons io20030203.000550`` instead of a newer one. Does anybody have an idea what could have caused it? I will put "dependencyInsight" in the thread.
    n
    t
    v
    • 4
    • 16
  • s

    Sachin Bavale

    11/10/2025, 11:08 AM
    Hello Team, I want to retrieve credentials from windows credentials and then I want to apply plugin (customized one, present at artifactory that needs credentials) is it achievable. I tried different ways however no luck. could you please assist how we can do it
    v
    k
    • 3
    • 6
  • e

    Eug

    11/10/2025, 1:37 PM
    What is default gradle JDK GC specification?
    v
    • 2
    • 7
  • c

    Caleb Cushing

    11/10/2025, 5:58 PM
    In kotlin I'm doing
    Copy code
    source(sourceSets.main.map { it.output.generatedSourcesDirs })
    but to convert to java...
    Copy code
    var sourceSets = project.getExtensions().getByType(SourceSetContainer.class);
    getByName
    doens't have any kind of way to map off that into a provider. assuming this is less efficient
    Copy code
    javadoc.source(sourceSets.getByName("main").getOutput().getGeneratedSourcesDirs());
    how should I convert to a provider here?
    p
    • 2
    • 4
  • s

    Sammie W

    11/10/2025, 7:44 PM
    Howdy! I hope y'all are well. I'm trying to build a project (https://github.com/mitakeck/EarPodsForAndroid) I've come across on GitHub recently, but it looks to use a relatively outdated version of Gradle (and JDK) from 2014. I've been able to download the required platforms (Gradle, JDK), but it's been throwing issues throughout the process (calling on outdated repositories, throwing errors about specific functions) and I haven't been able to successfully compile it via the CLI yet. I've attempted to build the project using a "compatible" setup (the one called upon by the build.gradle file and an equivalent version of JDE). and using a more recent setup with the most recent versions of Gradle (9.2.0) and JDK (25.0.1), neither to much avail. I'm currently attempting the build on Windows 10 through Powershell. "Recent" setup: • Gradle 9.2.0 • JDK 25.0.1 • Code run: .\gradle.bat build -p [path to project] • Error received: Build failed with an exception. [build.gradle] line 5. Could not find method jcenter() for arguments [] on repository container of type org.api.internal.artifacts.dsl.DefaultRepositoryHandler. "Compatible" setup: • Gradle 1.12 • JDK 7u80 • Code run: .\gradlew.bat build • Error received: Build failed with an exception. [app\build.gradle] line 1. Could not create plugin of type 'AppPlugin'. For "compatible" setup, error previously thrown regarding unavailable repository, resolved by introducing functioning repositories. End Goal: The program is intended to be an application or driver for Android (.apk), and I am hoping to build it for use in my device. I apologize if this isn't the right place to ask this, I'm happy to ask anywhere else if it would be better.
    c
    s
    • 3
    • 4
  • m

    Matthew Von-Maszewski

    11/11/2025, 8:07 PM
    Is there a way to have gradle ignore dependency checking, basically assume everything is up-to-date, and simply execute the desired java test? We have an old process that uses gradlew to build the product on a "bigger" AWS instance, then zip it up and send it to a "smaller" AWS instance. It then starts the gradlew based java test. For years, no one noticed that gradle is rebuilding the entire product (and downloading the 3rd party dependencies) on this two core machine. Hoping for a simple command line solution.
    p
    v
    e
    • 4
    • 10
  • l

    Lauritz Ritter

    11/11/2025, 10:56 PM
    Hey, does anyone know how i can resolve this error in my build, i am using kotlin 2.0.21 and i dont understand why it keeps looking for 1.9.25, maybe its a dumb question but would be grateful if anyone has an idea for me.
    Copy code
    Android gradle plugin: 8.6.0
    Gradle: 8.10.2
    FAILURE:
    Build failed with an exception.
    * What went wrong:
    Could not determine the dependencies of task ':expo-modules-core:compileReleaseKotlin'.
    > Could not resolve all dependencies for configuration ':expo-modules-core:kotlin-extension'.
       > Could not resolve all dependencies for configuration ':expo-modules-core:kotlin-extension'.
          > Could not find org.jetbrains.kotlin:kotlin-compose-compiler-plugin-embeddable:1.9.25.
            Searched in the following locations:
              - <http://maven.production.caches.eas-build.internal/artifactory/libs-release/org/jetbrains/kotlin/kotlin-compose-compiler-plugin-embeddable/1.9.25/kotlin-compose-compiler-plugin-embeddable-1.9.25.pom>
    v
    • 2
    • 4
  • c

    Colton Idle

    11/13/2025, 6:22 AM
    I'm slowly migrating a big project from groovy to kts. I'm trying to migrate this
    Copy code
    allprojects {
      allprojects {
        tasks.withType(JavaCompile).tap {
          configureEach {
            options.compilerArgs << "-Xlint:deprecation" << "-Xlint:unchecked"
          }
        }
      }
    }
    I want to just delete it because i dont know what it does. this is in the root build file in an android project. No one on the team seems to know why it was needed, but people dont want to remove it 😂 the allprojects within allprojects is just weird to me. I'm not sure if these are even valid lint flags (what linter? android-lint? or does java have a linter?)
    r
    v
    • 3
    • 9
  • n

    Niels Doucet

    11/13/2025, 11:01 AM
    How can I depend on the war created in a different module? I see the plugin creates a variant in the
    archives
    configuration, but I can't seem to resolve that from a different module 🤔
    Copy code
    --------------------------------------------------
    Variant archives
    --------------------------------------------------
    Configuration for archive artifacts.
    
    Capabilities
        - com.acme:web-module:0.0.0 (default capability)
    Artifacts
        - build/libs/web-module-0.0.0.jar (artifactType = jar)
        - build/libs/web-module-0.0.0.war (artifactType = war)
    I tried
    Copy code
    implementation(projects.webModule) { artifact { type = "war" } }
    or
    implementation(projects.webModule) { artifact { extension = "war" } }
    but neither worked resulting in
    Copy code
    Could not find web-module.war (project :web-module).
    According to the documentation, the
    war
    plugin creates a new
    components.web
    component, but I'm not sure how to depend on/resolve that.
    ✅ 1
    v
    • 2
    • 2
  • b

    Bernhard Posselt

    11/13/2025, 12:22 PM
    Is there a way to isolate the classpath of a thirdparty plugin?
    ✅ 2
    c
    v
    • 3
    • 23
  • m

    Miha Markic

    11/14/2025, 8:12 AM
    hi, can somebody help me with running code after build has finished? looks like I've solved it I'm looking at thread https://github.com/gradle/gradle/issues/20151 So, the `BuildListener.buildFinished`still works, but is deprecated and thus I'd like to use an officially recommended approach. However data flow actions don't work for me for a (probably stupid) reason
    v
    • 2
    • 8
  • t

    TheGoesen

    11/14/2025, 9:14 AM
    Hello, using :outgoingVariants I can debug attributes and artifacts provided by the configuration. Is there an option to also show dependencies for these outgoing variants?
    👀 1
    v
    m
    • 3
    • 35
  • m

    Miha Markic

    11/14/2025, 9:22 AM
    is there a better way in 2025 to get flavor value in build script than parsing
    Copy code
    gradle.startParameter.taskRequests.toString()
    ?
    н
    v
    • 3
    • 76
  • f

    Fanish

    11/14/2025, 9:35 AM
    I have imported a gradle project in eclipse. There are two modules A and B. A has dependency on test jar of B something like below testImplementation project(path: 'commonplugins:common.domain', configuration: 'tests') build is getting successfull but eclipse is showing errors for imports of classes coming from test jar of B. test jar configuration in B (commonpluginscommon.domain) is done like this configurations { tests } tasks.register('testsJar', Jar) { archiveClassifier = 'tests' from(sourceSets.test.output) } artifacts { archives(tasks.named("testsJar")) tests testsJar } Why eclipse is failing to resolve?
    v
    • 2
    • 3
  • a

    Andrew Lethbridge

    11/14/2025, 4:27 PM
    Hey folks. Weve been using Gradle project level Toolchains to manage Java versions for quite some time and it all works great. We are trying to start using this feature for the Daemon itself, and are encountering a lot of issues on our corporate laptops. All of the issues manifest themselves as issues with PATH. It's not consistent, some people it works great and others it doesn't work at all. I'm wondering if anyone here has much experience with this feature and may be able to chime in here. We are using Gradle 8.14.1 and trying to run Java 21. All of the issues manifest themselves as "cannot run program". We shell out a lot in our Gradle plugins to run things like docker, etc. It seems like for some reason in some situations, the PATH from the parent process is not being passed to the subsequent daemon that gets spun up from the toolchain JDK.
    v
    t
    • 3
    • 29
  • c

    Colton Idle

    11/14/2025, 7:23 PM
    I'm migrating from groovy to kts. In my root build.gradle we have
    Copy code
    subprojects {
      configurations.configureEach {
        resolutionStrategy ...
      }
      afterEvaluate { subproject ->
        subproject.apply from: "$subproject.rootDir/jacocoTask.gradle"  
      }
    }
    I updated the after evaluate in kts to
    Copy code
    afterEvaluate {
        apply { from("$rootDir/jacocoTask.gradle") }
      }
    but now I get an error in my jacocoTask.gradle file on this line
    task coverageReport(type: JacocoReport...
    So my questions are: 1. Is my conversion correct? 2. I'm assuming the previous code was not correct since I now get an error in my jacoco Task.gradle file? I guess it wasn't being executed at all before? 😱 I'm new to this project so its been ad adventure trying to modernize some of these things 😅
    v
    e
    • 3
    • 17
  • i

    Ivan CLOVIS Canet

    11/15/2025, 12:04 PM
    I want the exact behavior of
    pluginManager.withPlugin
    , but I don't know the plugin ID. • I want to supply a configuration option to be executed when the plugin is added • If the plugin is already added, I want it to execute it immediately However, this plugin doesn't have an ID. It's https://github.com/JetBrains/kotlin/blob/master/libraries/tools/kotlin-gradle-plug[…]n/org/jetbrains/kotlin/gradle/targets/js/nodejs/NodeJsPlugin.kt (from KGP)
    v
    • 2
    • 4