unable to resolve jsonSlurper even when its imported and groovy package added to gradle.build

Advertisements

Im trying groovy project and I cant get it running with trying jsonSlurper. Not sure why.
The dependency for groovy is added and import.groovy.json.* is imported.

gradle:

dependencies {
    implementation 'org.apache.groovy:groovy:4.0.2'
    testImplementation platform('org.junit:junit-bom:5.9.1')
    testImplementation 'org.junit.jupiter:junit-jupiter'
}

Error:
Unable to resolve class JsonSlurper

>Solution :

Add

implementation 'org.apache.groovy:groovy-json:4.0.2'

Might as well update to 4.0.11 as well whilst you’re there

Leave a ReplyCancel reply