I am facing an error dowloading junit from mavenCentral.
The error:
> Could not find method testImplementation() for arguments [org.junit.jupiter:junit-jupiter-api:5.9.3] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
Of course I have already checked and the dependency exists in maven central repository. The build gradle file is quite easy and I am using a gradle wrapper.
build.gradle
repositories {
mavenCentral()
}
dependencies {
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.3'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.3'
}
test {
useJUnitPlatform()
}
gradle-wrapper.properties
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Any idea what to check?