Martin
05/31/2025, 11:54 AMcompileClasspath
of the project, I want what other projects will see when depending on it. Seems like apiElements
is closer to what I want but it doesn't show any dependencies in ./gradlew dependencies
Vishwanth Prakash
05/31/2025, 12:18 PMWARNING: The following problems were found when resolving the SDK location:
101
Where: ANDROID_SDK_ROOT environment variable. Problem: Directory does not exist
Could you help me with this case?Arjan van Wieringen (avwie)
06/01/2025, 8:19 AMThomas Chan
06/02/2025, 4:01 AMDivya Nair
06/02/2025, 4:48 PMClayton Walker
06/02/2025, 5:49 PMbuild-gradle-project:
# …existing configuration…
variables:
GRADLE_USER_HOME: $CI_PROJECT_DIR/.gradle
cache:
paths:
- .gradle/wrapper
Luis Mirabal
06/03/2025, 9:54 AMjunit-platform-launcher
. That guide also points to the Gradle 8 upgrade guide, and it says to fix it you should have the following in your dependencies:
dependencies {
testImplementation 'org.junit.jupiter:junit-jupiter:5.9.2'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
}
I was surprised to see that it worked as I'm not sure how Gradle resolves the version for the junit-platform-launcher
. I thought you needed a platform dependency to leave versions out.
How is the version resolve in that case? And is it actually a good practice?Philip W
06/03/2025, 12:43 PMmaven.mavenContent.includeGroupAndSubgroups
vs exclusiveContent.filter
in RepositoryHandler/repositories?JSP
06/03/2025, 5:14 PMPlugin [id: 'org.parchmentmc.librarian.forgegradle', version: '1.+'] was not found in any of the following sources:
although I have settings.gradle, gradle.properties and relevant files, or so I think. I've been at this for a long while so I really need to fix this.PHILIPPE Jean-Baptiste
06/04/2025, 12:59 PMStylianos Gakis
06/04/2025, 4:45 PMprivate fun Project.configureCommonDependencies(libs: LibrariesForLibs) {
dependencies {
val koinBom = libs.koin.bom
add("implementation", platform(koinBom))
add("implementation", project(":logging-public")) ...
}
}
}
Which lives in a convention plugin which we apply to all of our projects.
Now, we are switching some of these projects to be Kotlin Multiplatform projects. The problem arises that we can no longer just do add("implementation", ...
as it does not exist.
Using the kotlin DSL it instead then looks something like
kotlin {
sourceSets {
commonMain.dependencies {
implementation(...)
}
}
}
Is there some way for me to still rating this piece of code in this common place in my convention plugin, and conditionally do one or the other thing, depending on if the project in which it is being applied to is multiplatform or not?
And if yes, how would the syntax have to look for that? I am having a bit of a hard time figuring this out myself to be honestArjan van Wieringen (avwie)
06/07/2025, 2:26 PM.gradle
directory and selecting them does nothing.
I tried looking in IntelliJ logging, but it doesn't generate any logging when this triggers.
Is this a known issue?
I reduced it to a minimal reproducer: https://youtrack.jetbrains.com/issue/IDEA-374157/Download-Sources-not-working-for-Composite-BuildsAdam
06/07/2025, 5:25 PMDependencyArtifact#getUrl
, except in tests. It doesn't look like the value is ever read.
dependencies {
"fooConf"("blah:blah:1.2.3") {
artifact {
url = "<https://example.com/bar.zip>"
}
}
}
Josh Green
06/09/2025, 11:14 PM/*
* Gradle build file.
*/
apply plugin: 'java'
// Make sure we are using Java 8.
if(JavaVersion.current() != JavaVersion.VERSION_1_8)
throw new GradleException("This project requires Java 8, but it's running on "+JavaVersion.current())
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
repositories {
//jcenter()
mavenCentral()
}
dependencies {
// Use JUnit test framework
testImplementation 'junit:junit:4.13.2'
}
And here's the error I'm getting:
> Could not resolve junit:junit:4.13.2.
> Could not get resource '<https://repo.maven.apache.org/maven2/junit/junit/4.13.2/junit-4.13.2.pom>'.
> org.apache.http.ssl.SSLInitializationException: NONE (The system cannot find the file specified)
Sam Pengilly
06/11/2025, 6:33 AM-Xmx4g
setting on the gradle daemon tends to only use about 5gb max between the main daemon process and all child processes. Looking at a build scan it appears to rarely reach that amount and spends most of the build using around 2-4gb of memory. Running htop on the macbook while the build runs shows that the total used memory on the machine (including all other apps, browser, slack, etc) hovers stably around 5-7gb.
Meanwhile if I run exactly the same build, with exactly the same gradle properties (specifying the same number of max workers) inside a docker image on the same macbook (docker configured with 10gb max memory), all of a sudden that build continues to eat more and more memory, eventually blowing past 8-9gb and eventually using all 10gb available resulting the daemon being killed in the background.
I'm not sure what to make of it. It implies there's something going on either in the OS (ubuntu vs macOS) or in docker, or the JVM, or in gradle itself. I've tried dozens of different combinations of JVM options and flags, I'm running Java 21 for the build toolchain on top of a Java 23 installation so flags like UseContainerSupport
should be on by default. I've toyed with ensuring that MaxMetaspace
is set when overriding org.gradle.jvmargs
, I've set Java options globally for all java instances to try to constrain memory of child processes, etc. None of it has seemed to have any effect.Suresh Maidaragi
06/11/2025, 11:21 AMAli
06/12/2025, 7:18 AMbuildSrc
directory to manage my conventions centrally. The project is structured as follows:
buildSrc/build.gradle.kts
This file defines the plugin dependencies and versions, for example:
val kotlinVersion = "2.0.21"
plugins {
`kotlin-dsl`
}
repositories {
gradlePluginPortal()
mavenCentral()
}
dependencies {
implementation("org.springframework.boot:spring-boot-gradle-plugin:3.3.11")
runtimeOnly("io.spring.gradle:dependency-management-plugin:1.1.7")
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion")
implementation("org.jetbrains.kotlin.plugin.spring:org.jetbrains.kotlin.plugin.spring.gradle.plugin:$kotlinVersion")
implementation("io.gitlab.arturbosch.detekt:detekt-gradle-plugin:1.23.8")
implementation(platform("com.fasterxml.jackson:jackson-bom:2.19.0"))
}
buildSrc/src/main/kotlin/standard-convention.kts
This file contains standard configurations that I use as plugins across my modules or submodules. Here is an excerpt:
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.tasks.KotlinJvmCompile
plugins {
kotlin("jvm")
kotlin("kapt")
id("io.gitlab.arturbosch.detekt")
}
group = "com.example"
version = "0.0.1-SNAPSHOT"
repositories {
mavenCentral()
}
detekt {
config.setFrom("${rootProject.projectDir}/buildSrc/src/main/resources/detekt-config.yml")
buildUponDefaultConfig = true
}
dependencies {
implementation("org.jetbrains.kotlin:kotlin-reflect")
detektPlugins("io.gitlab.arturbosch.detekt:detekt-formatting:1.23.8")
testImplementation(platform("org.junit:junit-bom:5.12.2"))
testImplementation("org.junit.jupiter:junit-jupiter")
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
}
java {
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
}
tasks.withType<KotlinJvmCompile>().configureEach {
compilerOptions {
jvmTarget.set(JvmTarget.JVM_21)
freeCompilerArgs.add("-Xjsr305=strict")
}
}
tasks.test {
useJUnitPlatform()
}
Besides this, I also have other convention plugins that I use across different modules.
I would now like to move my self-defined plugins into a separate project and publish them to a Git repository (or Maven repository), so that I can pull them as external dependencies into the modules that need them.
Is there a recommended approach for this?
Essentially, I want to decouple my plugins from buildSrc
and manage them as independent, reusable Gradle plugins that can be versioned and shared across multiple projects.
ThanksTrevJonez
06/12/2025, 4:01 PMe: file:[....]/ScreenshotPlugin.kt:62:69 None of the following functions can be called with the arguments supplied:
public constructor File(p0: File!, p1: String!) defined in java.io.File
private constructor File(p0: String!, p1: File!) defined in java.io.File
private constructor File(p0: String!, p1: Int) defined in java.io.File
public constructor File(p0: String!, p1: String!) defined in java.io.File
change is literally just the ksp dep and about as minimal as possible. both versions have no dependencies so not sure if I should be more suspect of some gradle behavior I don't understand or if I should report this to the KSP project.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 PM