Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

1.4K
Views
build.gradle cannot resolve symbol 'groovy.json.JsonSlurper'

I can't resolve the groovy.json.JsonSlurper in the build.gradle file with Intellij, does anyone know how to fix it?


plugins {
    id 'java'
}

group 'org.example'
version '1.0-SNAPSHOT'

repositories {
    mavenCentral()
}

dependencies {
    testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.1'
    testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.1'
}

test {
    useJUnitPlatform()
}



task sample() {
    doLast {
        sample();
    }
}

import groovy.json.JsonSlurper
def sample(){
    def json = new JsonSlurper().parseText('{"a":"b"}')
    println(json);
}

enter image description here

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

You missing the needed dependency.

Add org.codehaus.groovy:groovy-json:3.0.9 in dependencies section so ti will look like

dependencies {
    testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.1'
    testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.1'
    implementation 'org.codehaus.groovy:groovy-json:3.0.9'
}

And then you can test with CLI as gradle sample or ./gradlew sample and it will return {a=b}

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!