Javi
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 PMAlex Beggs
06/28/2025, 1:28 PM./gradlew -Pproperty1=helloworld :a:assemble
and C
will get configured with the property1
value being passed into the configuration. We use a version
file that contains some information that is used by C
but could be different based on the calling outer project A
or some other project. What would be the best practice to be able to read the version
file and pass it down to project C
?
Ideally I would be able to set the properties from the outer project A
before the configuration gets called for C
but that doesn't seem to be possible since A
happens after C
Is there something that can be done in the settings.gradle.kts?
I know this can be done via the root projects gradle.properties
or the command line -P
option, but it is unclear to me how it can be done outside of those options.
Is there a way to load a set of properties in the root project and pass those properties into the composite build?Mike Wacker
06/29/2025, 3:43 AMapi
vs. implementation
, if a Java annotation is applied to a public class or method, is that annotation part of the ABI (application binary interface)? And does the answer depend on the retention policy of the annotation (SOURCE
vs. CLASS
vs. RUNTIME
)? A practical example would be a public "value type" that's annotated with @Value.Immutable
, @JsonSerialize
, and @JsonDeserialize
. Are Immutables and Jackson api
or implementation
deps in that scenario?Martin
06/29/2025, 11:47 AMIvan CLOVIS Canet
06/29/2025, 6:55 PMdependencies {
dokka(projects.a)
dokka(projects.b)
kover(projects.a)
kover(projects.b)
nmcpAggregation(projects.a)
nmcpAggregation(projects.b)
// …
}
which is not fun to maintain when there are dozens of projects.
Instead, I'd rather have:
dependencies {
library(projects.a)
library(projects.b)
}
where library
is a custom configuration that applies its contents to dokka
, kover
and nmcpAggregation
.
I've tried:
val library by configurations.registering {
isCanBeResolved = false
isCanBeConsumed = false
}
configurations.dokka.get().extendsFrom(library.get())
configurations.kover.get().extendsFrom(library.get())
configurations.nmcpAggregation.get().extendsFrom(library.get())
but that only seems to partially work.
I'm testing it in a build that looks like
Root project 'Kotlin-example'
+--- Project ':app'
+--- Project ':core'
+--- Project ':mkdocs'
\--- Project ':plugin'
where the root project contains
dependencies {
library(projects.core)
}
The NMCP plugin seems to pick up the dependency:
$ … dependencies --configuration nmcpAggregation
nmcpAggregation
\--- project :core FAILED
However, the Kover configuration gets the current project for some reason:
$ … dependencies --configuration kover
kover (n)
\--- project Kotlin-example (n)
And the Dokka plugin doesn't get anything at all:
$ … dependencies --configuration dokka
dokka - Fetch all Dokka files from all configurations in other subprojects. (n)
No dependencies
What's going on? If extendsFrom
isn't the correct way to do this, what is?Roldan Galan
06/30/2025, 1:41 PMThe build cache configuration of the root build differs from the build cache configuration of the early evaluated ':projectA', ':projectB' included builds. It is recommended to keep them consistent, see here.
That documentations says:
Such included builds will inherit the build cache configuration from the top level build, regardless of whether the included builds define build cache configuration themselves or not. The build cache configuration present for any included build is effectively ignored, in favour of the top level build’s configuration.I have no specific build cache configuration on such included build modules, so I am actually expecting to inherit the build cache config from my root build. If the build cache configuration on the included builds is going to be ignored and inherit whatever is in the root build... what is the purpose of such warning? 🤔 I would understand it if I had some specific build cache config that conflicts with the root. But does it make sense to flag this when there is nothing defined in the included builds? Thanks!
Amit Kumar Chauhan CB Ara
06/30/2025, 2:06 PMThe request for this plugin could not be satisfied because the plugin is already on the classpath with a different version (1.8.22).* 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 15s Running Gradle task 'assembleDebug'... 15.9s Error: Gradle task assembleDebug failed with exit code 1}
Colton Idle
06/30/2025, 6:57 PMorg.gradle.jvmargs= -Xmx12g -Xms4g
set in our android project in the gradle.properties for the repo. Can I override that easily without having to commit those changes to my entire team? I'd love to bump the 12g down to 6g.
Everything I'm reading basically says that the project ones will take pretty much the highest priority, but that seems weird as if theres no way to update it to my personal prefs without affecting the whole teamKelvin Chung
07/01/2025, 7:06 AMjacoco
plugin to work with a Kotlin Multiplatform project that has a jvm target. A few questions:
1. When setting up my own convention plugin, is there a way to not apply the jacoco
plugin if a KMP project does not have a JVM target?
2. Do we need to explicitly make jacocoTestReport
explicitly depend on jvmTest
, like we do with test
in a Kotlin JVM project?
Any help would be appreciated.Jendrik Johannes
07/01/2025, 11:41 AMFileTree
?
Input is:
src
└── a
├── b
│ └── c
│ └── x.tmp
└── z.txt
Some task using matching
:
val src = layout.projectDirectory.dir("src").asFileTree.matching {
include("**/*.txt")
}
tasks.register<Sync>("sync") {
from(src)
into(layout.buildDirectory.dir("target"))
}
Then I get (I find it surprising that **/*.txt
matches the directories 🤷♀️ )
build/target
└── a
├── b
│ └── c
└── z.txt
How do I get?
build/target
└── a
└── z.txt
(Wrong solutions in Thread)Kelvin Chung
07/02/2025, 4:36 AMdependencies {
testReportAggregation("...") // coordinates of the KMP included build
}
which is normal, but I get an error saying
> Could not resolve all dependencies for configuration ':aggregation:testing:aggregateTestReportResults'.
> The consumer was configured to find a component of category 'verification', as well as attribute 'org.gradle.testsuite.name' with value 'test', attribute 'org.gradle.verificationtype' with value 'test-results'.
Which is weird, since I get test reports from my KMP included build by running allTests
and jvmTests
, as expected.Martin
07/02/2025, 12:12 PMMax Douglas
07/02/2025, 6:17 PMBen Berman
07/02/2025, 7:40 PMExec
when the task receives Ctrl+C
, but everything else can?
I have found around 220 reports of issues related to this, since at least 2013
What am I not understanding?Ian Ager
07/02/2025, 8:41 PMapi platform("com.fasterxml.jackson:jackson-bom:2.18.0")
dependencies across all my libraries and to my surprise that’s made the warnings go away. Still curious if anybody knows what the problem actually was here though? Is declaring a BOM as an api
dependency such a bad offence that it’s expected gradle would behave unpredictably?Clayton Walker
07/02/2025, 10:01 PMKelvin Chung
07/03/2025, 1:31 AMplugins {
kotlin("multiplatform")
}
kotlin {
jvm()
}
tasks.register("doSomething") {
dependsOn(tasks.jvmTest)
}
That last part doesn't compile, probably because there is no accessor for jvmTest
even though by all rights it should exist. Of course, changing it to tasks.named("jvmTest")
works, but what would cause the accessors to not be useable? (Compare this to, say, commonMain
, which is useable)