Vladimir Sitnikov
08/05/2025, 8:30 AMjava.lang.NoClassDefFoundError: org/gradle/util/VersionNumber
Well, Gradle had VersionNumber
class for quite some time, and it is sad Gradle 9 broke backward compatibility with plugins which still use VersionNumber
from org.gradle.util
I wonder what are the benefits for Gradle to drop the class. My guess is it does not require much efforts to support.
It would be so much better if Gradle used something like @Deprecated(level=Hidden)
instead of dropping the class.Pratikshit singh
08/05/2025, 10:11 AMblubb
08/05/2025, 2:02 PMXeno
08/05/2025, 3:54 PMbeforeSettings
phase and for regular dependencies in the projectsLoaded
phase. However, I have been struggling for a while to determine in which hook I should add transitive dependencies for plugins. For example, the plugin (com.gradleup.shadow
) has the following dependencies:
- org.vafer:jdependency
- org.apache.logging.log4j:log4j-core
- org.codehaus.plexus:plexus-xml
- org.codehaus.plexus:plexus-utils
- commons-io:commons-io
- org.jdom:jdom2
- org.apache.ant:ant
All of these dependencies are present in my system, including their artifacts and POM files. Currently, my plugin is unable to resolve transitive dependencies for plugins because I am unsure about the correct hook to use for adding them to the configuration and the precise method to do so. As a result, the build process fails with an error.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':shadowJar'.
org/vafer/jdependency/Clazzpath* Try:
Run with --stacktrace option to get the stack trace.
Run with --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 1s 5 actionable tasks: 1 executed, 4 up-to-date and if I add this to build.gradle
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath("org.apache.ant:ant:1.10.14")
classpath("org.ow2.asm:asm-commons:9.8")
classpath("org.ow2.asm:asm:9.8")
classpath("commons-io:commons-io:2.18.0")
classpath("org.vafer:jdependency:2.13")
}
}
then I get
BUILD SUCCESSFUL in 1s
6 actionable tasks: 6 up-to-date
Moreover, both attempts were made in an environment without Internet access and with a cleared cache.
Please tell me how to correctly add such dependencies to the configuration using the API so that they fall into the plugin classpath, I will be very grateful
Leroy Anon
08/05/2025, 4:15 PMArthur McGibbon
08/05/2025, 4:22 PMsrc/main/dist/bin
lose their exec attribute when being copied into the archive by the distribution plugin. That's a bug isn't it?Adam
08/06/2025, 2:09 PMtaskB
depends on taskA
, but taskB
is disabled. When I run gradle taskB
, why does Gradle still run taskA
? Shouldn't it also be skipped?
val taskA by tasks.registering {
doLast {
println("running $path")
}
}
val taskB by tasks.registering {
enabled = false
onlyIf { false }
dependsOn(taskA)
doLast {
println("running $path")
}
}
./gradlew taskB
> Task :taskA
running :taskA
> Task :taskB SKIPPED
BUILD SUCCESSFUL in 175ms
Philipp Nowak
08/08/2025, 7:14 AMfalse
and the other one to true
to see the impact. Is that possible? I thought about using system-properties
but it doesn't seem to be the right one here since it translates to the -D
arg instead of -P
Lucas Holden
08/09/2025, 6:17 AMdependencies {
myCfg(project(":common"))
}
configurations {
myCfg {
canBeResolved = true
canBeConsumed = false
attributes {
attribute(MyAttributes.PLATFORM, "thisPlatform")
attribute(MyAttributes.SOURCETYPE, "main")
}
}
// both of these somehow use :common's default export, which is a different jar to the one myCfg consumes
compileClasspath.extendsFrom(myCfg)
runtimeClasspath.extendsFrom(myCfg)
}
Mohamed Abderraouf ZOUAID
08/09/2025, 5:49 PMPicked up JAVA_TOOL_OPTIONS: -Dstdout.encoding=UTF-8 -Dstderr.encoding=UTF-8
FAILURE: Build failed with an exception.
* What went wrong:
Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.
> Cannot query the value of this provider because it has no value available.
* 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 1m 25s
Running Gradle task 'assembleDebug'... 88.4s
Error: Gradle task assembleDebug failed with exit code 1
anyone can help me please?edward ambroce
08/09/2025, 6:42 PMMartin
08/09/2025, 9:28 PMConsider enabling configuration cache to speed up this build
Lucas Holden
08/10/2025, 7:16 PMJP Sugarbroad
08/11/2025, 5:59 PMLucas Holden
08/11/2025, 7:59 PMLucas Holden
08/12/2025, 12:27 AMgradlePlugins.create
, but they both publish under the same group: the name of the project.Renรฉ
08/12/2025, 6:43 PMLucas Holden
08/12/2025, 8:43 PMattributeProvider
still tries to retrieve the extension property immediately and causes the plugin to fail to apply. (Line 23 of https://paste.ofcode.org/k36CjhiWRKJQkdv2FeyMZz)
Running it in project.afterEvaluate
does allow the plugin to be applied, but the artifact transform is unusable due to being applied so late.
Does anyone know how to make this work?James Smith
08/12/2025, 9:50 PMJames Smith
08/12/2025, 9:51 PMFAILURE: Build failed with an exception.
* What went wrong:
org.gradle.api.InvalidUserDataException: On plugin declaration 'kotlin' expected to find any of 'id' or 'version' but found unexpected keys 'android' and 'compose'.
> On plugin declaration 'kotlin' expected to find any of 'id' or 'version' but found unexpected keys 'android' and 'compose'.
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Get more help at <https://help.gradle.org>.
BUILD FAILED in 4
From what I have in my libs.version.toml
[plugins]
android.application = { id = "com.android.application", version.ref = "agp" }
kotlin.android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
kotlin.compose = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }
Can someone explain my issue a little, please?Lucas Holden
08/12/2025, 11:16 PMJames Smith
08/12/2025, 11:37 PMLucas Holden
08/13/2025, 7:42 PMMapProperty<String, List<Object>>
in my plugin extension. I need another plugin to merge items into the map instead of overwriting it like put
does.
I thought this would work:
extMap.putAll(extMap.map { m ->
m.keys.forEach { k ->
m.merge(k, myValues(), { l1, l2 -> l1 + l2 })
}
return@map m
})
but instead it causes a stack overflow error due to the value depending on itself.
I also can't add elements in Project.afterEvaluate
because MapProperty#get
returns an ImmutableMap.
How do I add items to the lists in the map?tony
08/15/2025, 5:53 PMBehnam Banaei
08/16/2025, 7:27 AMCaleb Cushing
08/16/2025, 12:58 PMJavi
08/16/2025, 2:51 PM* What went wrong:
A problem occurred configuring project ':semver-gradle-plugin'.
> Failed to notify project evaluation listener.
> Cannot mutate the hierarchy of configuration ':semver-gradle-plugin:apiElements' after the configuration was published as a variant. After a configuration has been observed, it should not be modified.
> Gradle Module Metadata can't be modified after an eagerly populated publication.
Javi
08/17/2025, 10:29 AMdependencyProject
is deprecated but on the deprecation it is not shown any alternative ๐คู ุญู ุฏ ุงุณุงู ู ุงูุจุฏูู
08/17/2025, 11:52 AMWhat is the solution to this error?
``````Mez
08/17/2025, 10:04 PM