Why Is it impossible to use json in Gradle from 8....
# gradle
f
Why Is it impossible to use json in Gradle from 8.0 onwards? I have some .kts scripts where I read some local files that are JSONs
c
Is there a specific error message or limitation you are referencing?
f
Limitation, JSON can’t be used in Gradle KTS probably groovy too 🤔
Copy code
org.json.simple.*
isn’t available
c
that’s a 3rd party library, not part of Gradle. Import the library as required to use it.
a
I’ve got a Gradle 7.6 project, and I can’t import
org.json.simple.*
, so this isn’t particular to Gradle 8. My guess is that you used to have a Gradle plugin that had a dependency on org.json, but you haven’t applied the plugin, or the plugin has been updated to remove that dependency. If you want to add the JSON library back, you can either do it in
./buildSrc/build.gradle.kts
, or as a buildscript dependency. Alternatively, Groovy can process JSON
f
Thanks guys!
113 Views