Gradle Build Fails: cannot resolve org.apache.maven:maven-core:${project.prerequisites.maven}

Hi all.
I have a problem when adding dependency into the file build.gradle

implementation 'com.squareup:square:27.1.0.20230119'

I got the error when build

Execution failed for task ‘:compileJava’.
Could not resolve all files for configuration ‘:compileClasspath’.
Could not find org.apache.maven:maven-core:${project.prerequisites.maven}.
Required by:
project : > com.squareup:square:27.1.0.20230119 > io.apimatic:core:0.3.0 > org.jacoco:jacoco-maven-plugin:0.8.5

Possible solution:

I use:

  • Square SDK version: 27.1.0.20230119
  • Gradle: 7.6
  • JDK: 11

Please help me resolve this prolem.
Thanks

Hey there! I’ve encountered a similar issue before. It looks like the problem might be related to the Maven repository not being properly declared. You can try adding the Maven repository for the required artifact in your build.gradle file. Here’s an example:

gradleCopy code

repositories {
    mavenCentral()
}

Make sure to include this block in your build.gradle file, sync your project, and then try building again. It should help resolve the issue.