I am new to the Gradle and Groovy worlds. I have created a sample gradle-groovy project where I have added a dependency, and I want to make calls to those dependency classes and methods from my groovy file. But unfortunately, I am not able to build the project due to imported classes not being identified by my Groovy file, and I am getting an error message.
unable to resolve class com.fasterxml.jackson.databind.ObjectMapper
@ line 3, column 1.
import com.fasterxml.jackson.databind.ObjectMapper
Below added my project structure and build.gradle file
I am trying to import com.fasterxml.jackson.core:jackson-databind:2.15.1 jar from maven central repository and trying to create an object of ObjectMapper class.
For checking whether I am doing it correctly or not, I have created a gradle-java project, and from it I have added the same com.fasterxml.jackson.core:jackson-databind:2.15.1 dependency, and as expected, I was able to create an object of the ObjectMapper class provided by com.fasterxml.jackson.core:jackson-databind:2.15.1 and build the project. What am I doing wrong here?