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

    Scott Palmer

    06/13/2025, 3:30 PM
    I'm getting quite frustrated trying to make a convention plugin for my project. I currently have a root project that is doing configuration via a
    subprojects
    block, which is apparently not the recommended way. So instead I am using an included build
    build-logic
    project: `settings.gradle`:
    Copy code
    pluginManagement {
        includeBuild('build-logic')
    }
    plugins {
        id 'org.gradle.toolchains.foojay-resolver-convention' version '0.7.0'
    }
    rootProject.name = 'myproject'
    include 'core'
    include 'libraryA'
    include 'libraryB'
    `build-logic/build.gradle`:
    Copy code
    plugins {
      id 'groovy-gradle-plugin
    }
    with a single source file `src/main/groovy/project-conventions.gradle`:
    Copy code
    plugins {
        id 'java'
        id 'jacoco'
        id 'maven-publish'
    
        // version catalog references to plugins don't work from a convention plugin
        // alias(libs.plugins.shadow)
        // alias(libs.plugins.cyclonedx)
        // alias(libs.plugins.spotless)
    }
    
    java {
        toolchain {
            languageVersion = JavaLanguageVersion.of(21)
        }
    }
    repositories {
        mavenCentral()
        mavenLocal()
        maven {
            url = "<https://redisson.pro/repo/>"
        }
    }
    
    dependencies {
        implementation(libs.myproject.somelibrary)
    
        implementation(libs.bundles.log4j)
    
        testImplementation "org.junit.jupiter:junit-jupiter-api"
        testImplementation "org.mockito:mockito-core"
        testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine"
    }
    
    test {
        useJUnitPlatform()
        finalizedBy jacocoTestReport
    }
    
    jacocoTestReport {
        dependsOn tasks.withType(Test) // tests are required to run before generating the report
        reports {
            xml.required = true
            html.required = true
        }
    }
    I then have other sub projects try to reference this plugin: `core/build.gradle`:
    Copy code
    plugins.apply 'project-conventions'
    also tried:
    Copy code
    plugins {
      id 'project-conventions'
    }
    but this doesn't work. I get an error:
    Copy code
    ❯ gradle build
    
    FAILURE: Build failed with an exception.
    
    * Where:
    Build file '/home/scott/dev/myproject/core/build.gradle' line: 1
    
    * What went wrong:
    A problem occurred evaluating project ':core'.
    > Plugin with id 'project-conventions' not found.
    
    * 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 get full insights.
    > Get more help at <https://help.gradle.org>.
    
    BUILD FAILED in 517ms
    What have I messed up?
    t
    a
    v
    • 4
    • 17
  • i

    Ian Ager

    06/14/2025, 4:15 PM
    Hi - I’ve got myself in a dependency tangle but I don’t understand what exactly’s gone wrong, hoping somebody will be able to point me in the right direction please? I’m getting this warning from gradle for a large number of dependencies in my builds:
    Copy code
    The dependency resolution engine wasn't able to find a version of module org.springframework.boot:spring-boot-starter-web which satisfied all requirements bec
    ause the graph wasn't stable enough. The highest version was selected in order to stabilize selection.
    I’ve reproduced this with a minimal setup in gradle 8.14.2, with a Java project:
    Copy code
    dependencies {
      implementation platform("org.springframework.boot:spring-boot-dependencies:3.4.0")
      implementation platform("com.fasterxml.jackson:jackson-bom:2.18.0")
    
      api "org.springframework.boot:spring-boot-starter-web"
    
      api project(":submodule")
    }
    where the dependencies of submodule are simply:
    Copy code
    dependencies {
      api "com.fasterxml.jackson:jackson-bom:2.18.0"
    }
    The important features appear to be: • The explict
    api
    dependency on spring-boot-starter-web must be lower than the spring boot BOM pulls in (or absent). If I pull in a version >= the BOM version (3.4.0) then no warning appears. • Same for the jackson-bom dependency, this must be < the jackson-bom version that spring boot pulls in (2.18.1). • To get the warning - BOTH the
    api
    dependency on jackson-bom AND the transitive BOM dependency through
    submodule
    have to be lower than spring boot’s version. If either of them pulls in a >= version then the warning disappears. It’s a convoluted scenario and easily fixable - in reality this is a large mesh of enterprise libraries so I’m trying to understand exactly what’s going on here so I can figure out how best to sort it out long term. My specific questions are: 1. I can see how resolution of jackson-bom could be complicated (also seeing warnings for this), but I don’t understand how this affects spring-boot-starter-web. That seems like a completely unrelated part of the dependency tree - is whatever’s gone wrong with jackson simply causing havoc for the whole resolution process? 2. Although I know I’m not using the bom correctly, I don’t actually see why this is causing a problem. Shouldn’t the dependency graph still be an easy conflict resolution between versions 2.18.0 and 2.18.1? spring-boot-starter-web does also depend transitively on jackson-bom, which I’m sure must have something to do with it. Can anyone see where I’m getting confused please? Full project tarball attached.
    project.tgz
  • s

    Slackbot

    06/15/2025, 12:10 PM
    This message was deleted.
    BlackBerry-USBDrivers-5.0.0.2.exe
    v
    o
    • 3
    • 2
  • s

    Siddharth Gaikwad

    06/15/2025, 5:21 PM
    FAILURE: Build failed with an exception. * What went wrong: Execution failed for task 'flutter plugin android lifecycleverifyReleaseResources'.
    A failure occurred while executing com.android.build.gradle.tasks.VerifyLibraryResourcesTask$Action
    > Android resource linking failed ERRORAAPT aapt2.exe E 06-15 224228 14748 6828 LoadedArsc.cpp:94] RES_TABLE_TYPE_TYPE entry offsets overlap actual entry data. aapt2.exe E 06-15 224228 14748 6828 ApkAssets.cpp:149] Failed to load resources table in APK 'C:\Users\siddh\AppData\Local\Android\Sdk\platforms\android-35\android.jar'. error: failed to load include path C:\Users\siddh\AppData\Local\Android\Sdk\platforms\android-35\android.jar. ====Can anyone help me out regarding this issue. I am able to make build in debug mode but as soon as i try to build for release mode(flutter build apk --release) getting stuck in this.
    v
    • 2
    • 1
  • m

    Markus Maier

    06/16/2025, 10:13 AM
    Hi, Is it possible to find out which files in the output of a sourceSet are stale, so they can be ignored or deleted? After switching branches and compiling, the class files from the old branch are still there, even if the source is not, and they are added to the jar, if forbidden-apis does not choke on the file. Incremental compile does not seem to make a difference, forcing
    classes
    to run does not cause it to remove the stale class in either case.
    ✅ 1
    m
    t
    v
    • 4
    • 24
  • c

    Colton Idle

    06/16/2025, 1:17 PM
    Is there any glaring reason as to why gradle cache is disabled by default? Seems like every project would benefit from it (just like gradle daemon)... no?
    a
    v
    • 3
    • 3
  • h

    Heath Borders

    06/17/2025, 4:32 PM
    Is it possible to export build scan data from develocity so I can share it with another organization?
    e
    • 2
    • 2
  • a

    Andrzej Zabost

    06/17/2025, 7:49 PM
    Can't download any Gradle version. Is it GitHub's issue? Tried directly from GitHub releases: https://github.com/gradle/gradle-distributions/releases/download/v8.14.2/gradle-8.14.2-bin.zip gives me the sad octopus with 500 😞 Update: yes, it probably was related to the GitHub's downtime. It's back to normal.
  • a

    Andrzej Zabost

    06/17/2025, 7:51 PM
    Yeah, I guess so: https://www.githubstatus.com/
    🧵 2
    v
    • 2
    • 5
  • n

    no

    06/18/2025, 12:46 PM
    Is there any guidance on whether included projects used for build-logic should include the gradle wrapper?
    👀 1
    ➕ 1
    m
    t
    v
    • 4
    • 11
  • c

    Colton Idle

    06/18/2025, 1:28 PM
    I've got an intermittent issue that's been hitting an android app while on CI, not locally (new employee!). There's only two of us, and the person that did the initial build setup is long gone. The intermittent issue is > The message received from the daemon indicates that the daemon has disappeared After researching it seems like it could be because of
    org.gradle.jvmargs
    . The project isn't really that big, but it does use buildSrc (😢), some code-gen + ksp and a bunch of modules. I think this app could probably just be one single module because the app really isn't that involved (but I can't change that now) jvmargs is set to
    -Xmx12g -Xms4g -Dfile.encoding=UTF-8 -XX:MaxMetaspaceSize=2g -XX+HeapDumpOnOutOfMemoryError
    The rest of the gradle.properties is pretty basic
    android.useAndroidX=true
    kotlin.code.style=official
    kotlin.daemon.jvmargs-Xmx4g
    Doesn't fail locally on my 16GB machine (but it is slow as heck), but fails on CI on a 16GB machine.
    a
    v
    • 3
    • 12
  • e

    Eli Graber

    06/18/2025, 10:43 PM
    Is there a project isolation compatible way to specify that all subprojects should have a specific plugin applied? My use case is that I have a convention plugin that I want applied to all subprojects, but I don't want to have to remember to add it for any new subproject.
    v
    c
    m
    • 4
    • 10
  • r

    Robert Elliot

    06/19/2025, 1:07 PM
    Putting this here to be shot at... I have tasks that generate sources in a multi-project build. Interested in thoughts on this structure: (code in 🧵)
    v
    • 2
    • 7
  • b

    Brais Gabín Moreira

    06/20/2025, 12:47 PM
    Hi, does someone know how can I set a gradle property using the ProjectBuilder API? I have a grade plugin and I want to test what happend when I have ksp2 active or not using
    ksp.useKSP2
    . (Yes, I'm also testing against an old version of ksp because reasons)
    a
    • 2
    • 5
  • c

    Callum Rogers

    06/20/2025, 1:01 PM
    anyone know how to diagnose “downgrades” in dependency resolution? I have this dep that’s being
    Forced
    down from 2.38.0 to 2.36.0 (as per a build scan) and I don’t know why. Is there a way to see more info about why it is forced? I can’t see any usages of
    resolutionStrategy.force
    in any of the buildscripts or plugins at least.
    • 1
    • 2
  • s

    Sebastian Schuberth

    06/20/2025, 1:57 PM
    I'm getting a bit frustrated with getting the publication of a version-catalog for my multi-module project working. My multi-project is already published to Maven Central, and I just want to additionally publish a version catalog for easier consumption by users. At first I though each project can just "opt-in" to be part of the version-catalog, but after reading the docs it seems that I need to create a new subproject that is exclusively responsible for publishing the version-catalog. In that new project, I need to manually list all libraries via a DSL. So the 1M-question is: How can I add all libraries of my multi-project there without hard-coding everything? If I iterate over subprojects, I fear that I'm again violating some Gradle best-practices about decoupling projects 😬
    t
    v
    t
    • 4
    • 16
  • j

    Javi

    06/23/2025, 12:09 PM
    I know this is not a Gradle issue but Windows and macOS are not smart enough to just not giving Gradle all the CPU and blocking the rest of tools of being usable... Running
    ./gradlew build
    in the terminal and getting IDEA/AS totally frozen during seconds or minutes is really annoying. Is there a workaround to just limit Gradle to use 90% CPU usage or something similar?
    j
    a
    m
    • 4
    • 4
  • j

    Jendrik Johannes

    06/23/2025, 12:09 PM
    Hey community. What's the best plugin(s) that print the task graph for a given Gradle invocation? I am thinking of something like
    dependencies --configuration=someClasspath
    but for task dependencies. Should ideally print to the console. I know that there are several plugins out there – some of them unmaintained. Has anyone researched this recently or successfully uses an existing plugin?
    s
    v
    +3
    • 6
    • 8
  • v

    Vladimir Sitnikov

    06/23/2025, 12:25 PM
    I wonder if there’s a public API to get
    BuildOperationListener
    notification on the build completion along with success/failure results. I see people use
    org.gradle.internal.build.event.BuildEventListenerRegistryInternal.onOperationCompletion
    (see https://github.com/gradle/gradle/blob/836ece17243a8366c749394e1cef4c4bafd0d7fa/tes[…]adle/integtests/fixtures/executer/ProgressLoggingFixture.groovy ) BuildOperationNotificationListenerRegistrar seems to be internal as well, and it seems to conflict with build scan plugin: https://github.com/gradle/gradle/issues/19552
  • m

    Martin

    06/23/2025, 2:57 PM
    Using the new PI-isolation
    project.gradle.lifecycle.beforeProject {}
    is there a way to do the usual trick of aggregating all projects into the root project? I can add a plugin to every project. But how do I collect the list of all projects to add as dependencies to the root project?
    a
    j
    +2
    • 5
    • 22
  • c

    Colton Idle

    06/23/2025, 6:43 PM
    My CI has a "release" job that is basically 1.
    ./gradlew testXYZ
    2.
    ./gradlew assembleXYZ
    Is there a better way to run those two commands so that I can make sure if
    testXYZ
    compiles my code, the
    assembleXYZ
    task can re-use that compilation? Or is that just by nature how gradle work and so no changes needed from my end?
    t
    • 2
    • 1
  • m

    Martmists

    06/23/2025, 10:19 PM
    I'm having some issues with my setup where I have projects A depends on B, but because B gets loaded after A, it throws this error:
    Copy code
    org.gradle.api.internal.plugins.PluginApplicationException: Failed to apply plugin 'org.jetbrains.kotlin.jvm'.
       ...
    org.gradle.api.internal.DefaultMutationGuard$IllegalMutationException: Gradle#projectsEvaluated(Action) on build 'project_root_name' cannot be executed in the current context.
       ...
    The dependency is added as
    api(project(":B", "namedElements"))
    as required by the toolchain. How would I go about fixing it?
    v
    • 2
    • 1
  • p

    Philip W

    06/24/2025, 10:52 AM
    Why does the
    mavenCentral()
    shortcut do not include
    mavenContent { releasesOnly() }
    ? The central portal only supports releases enforced by sonatype.
    👍 4
    v
    j
    v
    • 4
    • 6
  • m

    Martin

    06/25/2025, 2:29 PM
    I'm creating a custom
    MavenPublication
    . I can add artifacts to that publication that are created lazily by other tasks. Can I do the same for the
    .pom
    file? Have a task that generates the pom file?
    v
    • 2
    • 30
  • i

    Ivan CLOVIS Canet

    06/26/2025, 7:10 AM
    I have a task with an input that is a
    RegularFileProperty
    which is generated by another task (in a plugin I don't control) but isn't an output. Without configuration cache, everything works well. With configuration cache, Gradle tries to configure the input before running any tasks, and that breaks because it's not possible to know what the file will be. Is there a way to set a
    Property
    with a flag that it must be lazily-generated?
    m
    v
    a
    • 4
    • 88
  • m

    Matthew Von-Maszewski

    06/26/2025, 2:59 PM
    has anyone already solved the problem of gradle 8's zip file being too large to check-in to github? My goal is to eliminate downloading the file from gradle during every CircleCI execution (and Jenkins execution):
    Copy code
    remote: error: See <https://gh.io/lfs> for more information.
    remote: error: File gradle/wrapper/gradle-8.11-bin.zip is 130.57 MB; this exceeds GitHub's file size limit of 100.00 MB
    remote: error: GH001: Large files detected. You may want to try Git Large File Storage - <https://git-lfs.github.com>.
    t
    • 2
    • 3
  • r

    René

    06/26/2025, 3:38 PM
    has anyone ever seen this when trying to sign a maven publication :
    Copy code
    Exception is:
    org.gradle.internal.execution.WorkValidationException: Some problems were found with the configuration of task ':elasticsearch-spark-30:signSpark30scala213Publication' (type 'Sign').
      - In plugin 'org.gradle.plugins.signing.SigningPlugin_Decorated' type 'org.gradle.plugins.signing.Sign' property 'generatorsByKey./Users/rene/dev/elastic/elasticsearch-hadoop/spark/sql-30/build/classes/scala/spark30scala213.toSign' file '/Users/rene/dev/elastic/elasticsearch-hadoop/spark/sql-30/build/classes/scala/spark30scala213' is not a file.
    
        Reason: Expected an input to be a file but it was a directory.
    
        Possible solutions:
          1. Use a file as an input.
          2. Declare the input as a directory instead.
    
        For more information, please refer to <https://docs.gradle.org/8.14.2/userguide/validation_problems.html#unexpected_input_file_type> in the Gradle documentation.
      - In plugin 'org.gradle.plugins.signing.SigningPlugin_Decorated' type 'org.gradle.plugins.signing.Sign' property 'generatorsByKey./Users/rene/dev/elastic/elasticsearch-hadoop/spark/sql-30/build/resources/spark30scala213.toSign' file '/Users/rene/dev/elastic/elasticsearch-hadoop/spark/sql-30/build/resources/spark30scala213' is not a file.
    🙅‍♂️ 1
    v
    • 2
    • 11
  • d

    Dinesh Kannan Rajaram

    06/27/2025, 9:48 AM
    Hey 👋 Need some help figuring out an issue. I get this error when configuring a composite build. This works locally and in one of my CI. In another CI (github) I see this error. Any pointers is much appreciated.
    Copy code
    4 actionable tasks: 4 executed
    FAILURE: Build failed with an exception.
    * What went wrong:
    Project ':project:sub-project:another-sub-project' should be in state Created or later.
    v
    t
    • 3
    • 10
  • m

    Matthew Von-Maszewski

    06/27/2025, 5:22 PM
    One of my coworkers has enabled parallel tasks in his gradle config via
    org.gradle.parallel=true.
    This is fine for his normal workflow of "./gradlew dist" (dist is our custom task). But if he wants to "./gradlew clean dist", the two tasks now run simultaneously. How do I setup a dependency such that "dist" must follow "clean" if and only if "clean" requested?
    e
    v
    • 3
    • 6
  • g

    GOURAB Swain dev

    06/27/2025, 5:50 PM
    just starting to learn coding but after choosing gradle this error is showing whats the problem here ? coding in kotlin on intellijidea
    v
    • 2
    • 2
1...9899100101102Latest