在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.
常出现在安装了升级到Gradle 7+后
解决办法:
compile and testCompile configurations are removed in Gradle 7+. You can use implementation and testImplementation instead.
使用implementation 替换 compile 即可
参考:
官方说明:https://docs.gradle.org/current/userguide/upgrading_version_6.html#sec:configuration_removal
intellij
https://intellij-support.jetbrains.com/hc/en-us/community/posts/4403048541330/comments/4403093188882
Gradle7+ Removed configuration glance