Scott Palmer
06/13/2025, 3:30 PMsubprojects
block, which is apparently not the recommended way. So instead I am using an included build build-logic
project:
`settings.gradle`:
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`:
plugins {
id 'groovy-gradle-plugin
}
with a single source file `src/main/groovy/project-conventions.gradle`:
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`:
plugins.apply 'project-conventions'
also tried:
plugins {
id 'project-conventions'
}
but this doesn't work. I get an error:
❯ 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?Ian Ager
06/14/2025, 4:15 PMThe 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:
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:
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.Slackbot
06/15/2025, 12:10 PMSiddharth Gaikwad
06/15/2025, 5:21 PMA 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.
Markus Maier
06/16/2025, 10:13 AMclasses
to run does not cause it to remove the stale class in either case.Colton Idle
06/16/2025, 1:17 PMHeath Borders
06/17/2025, 4:32 PMAndrzej Zabost
06/17/2025, 7:49 PMAndrzej Zabost
06/17/2025, 7:51 PMno
06/18/2025, 12:46 PMColton Idle
06/18/2025, 1:28 PMorg.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.Eli Graber
06/18/2025, 10:43 PMRobert Elliot
06/19/2025, 1:07 PMBrais Gabín Moreira
06/20/2025, 12:47 PMksp.useKSP2
. (Yes, I'm also testing against an old version of ksp because reasons)Callum Rogers
06/20/2025, 1:01 PMForced
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.Sebastian Schuberth
06/20/2025, 1:57 PMJavi
06/23/2025, 12:09 PM./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?Jendrik Johannes
06/23/2025, 12:09 PMdependencies --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?Vladimir Sitnikov
06/23/2025, 12:25 PMBuildOperationListener
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/19552Martin
06/23/2025, 2:57 PMproject.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?Colton Idle
06/23/2025, 6:43 PM./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?Martmists
06/23/2025, 10:19 PMorg.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?Philip W
06/24/2025, 10:52 AMmavenCentral()
shortcut do not include mavenContent { releasesOnly() }
? The central portal only supports releases enforced by sonatype.Martin
06/25/2025, 2:29 PMMavenPublication
. 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?Ivan CLOVIS Canet
06/26/2025, 7:10 AMRegularFileProperty
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?Matthew Von-Maszewski
06/26/2025, 2:59 PMremote: 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>.
René
06/26/2025, 3:38 PMException 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.
Dinesh Kannan Rajaram
06/27/2025, 9:48 AM4 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.
Matthew Von-Maszewski
06/27/2025, 5:22 PMorg.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?GOURAB Swain dev
06/27/2025, 5:50 PM