Closed McPringle closed 3 years ago
Well, the latest version of the plugin does define runtime
as the default configuration to be inspected
As a workaround you can set the value of configurations
to something else.
FWIW the plugin should work alright with Gradle 6.x. It's the jump to 7.x that will break it.
Crazy: With Gradle 7 and Kotlin 1.4.31 the build is green, with Gradle 7 and Kotlin 1.5.0 the build fails. If the plugin is not compatible with Gradle 7, why did it work the first time? Or did it not work and there is another problem, so the plugin is not getting executed? Just guessing.
If I modify the configuration to use runtimeOnly
(new) instead of runtime
(old), I get a new failure:
> Resolving dependency configuration 'runtimeOnly' is not allowed as it is defined as 'canBeResolved=false'.
Instead, a resolvable ('canBeResolved=true') dependency configuration that extends 'runtimeOnly' should be resolved.
Same with implementation
, but runtimeClasspath
seems to work fine!
Ah yes, Gradle 7 tightens up how configurations may be resolved 😓
I'll update the code to use runtimeClasspath
in stead of runtimeOnly
by default.
Now, why the plugin did not fail with Gradle 7 and Kotlin 1.4.31 but it did with Gradle 7 and Kotlin 1.5.0 is a mystery for me. Gradle compatibility rules no longer make sense to me.
Anyway, with the temporary solution to set the configuration manually and your fix for the next version of jdeps-gradle-plugin
, this issue is fixed.
thank you very much for your help, @aalmiray, I highly appreciate it!
Works fine with Kotlin <= 1.4.31:
Build successful! Now change Kotlin version in
gradle.properties
from1.4.31
to1.5.0
(line 19) and runcheck
again:Build fails:
I know, the configuration names changed in Gradle. But I did not change my Gradle version, just the Kotlin compiler version. I did both runs with Gradle v7.0.1 and jdeps 0.12.0. There is no project-specific jdeps configuration in my build file.