I wanted to use a local dependency (a jar file) relative to my root project directory in my main module as a buildscript classpath via dependencyResolutionManagement
in settings.gradle.kts
.
Here's my settings.gradle.kts
file:
pluginManagement {
repositories {
google()
mavenCentral()
}
}
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
maven { url = uri("https://jitpack.io") }
flatDir { dirs = setOf(File("plugins")) }
}
}
rootProject.name = "AndroidApp"
include(":main", ":base")
However, gradle is resolving the path as C:\Users\Name\.gradle\daemon\7.5\plugins
I have tried below and none of them works:
1. File(".").absolutePath // C:\Users\Name\.gradle\daemon\7.5\.
2. rootProject.path // :
3. rootProject.children.size // 0
nevermind. I have made two mistakes: