其他分享
首页 > 其他分享> > Could not find method compile() for arguments on object of type org.gradle.api.internal.artifacts.

Could not find method compile() for arguments on object of type org.gradle.api.internal.artifacts.

作者:互联网

在command line执行命令

gradle clean bootJar --no-daemon

报错

Could not find method compile() for arguments [io.micrometer:micrometer-registry-prometheus:1.5.11] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.

常出现在安装了OpenJDK 16 with gradle

解决办法:

compile and testCompile configurations are removed in Gradle 7+. You can use implementation and testImplementation instead.

使用implementation 替换 compile 即可

参考:
https://intellij-support.jetbrains.com/hc/en-us/community/posts/4403048541330-Could-not-find-method-testCompile-for-arguments-group-junit-name-junit-version-4-12-on-object-of-type-org-gradle-api-internal-artifacts-dsl-dependencies-DefaultDependencyHandler-

标签:artifacts,Could,object,gradle,compile,api,internal,find
来源: https://blog.csdn.net/evane1890/article/details/120423800