A problem occurred evaluating root project `'ngp'`.
> Could not resolve all artifacts for configuration `'classpath'`.
> Could not find com.bmuschko:gradle-docker-plugin:3.6.2.
Searched in the following locations:
- https://jcenter.bintray.com/com/bmuschko/gradle-docker-plugin/3.6.2/gradle-docker-plugin-3.6.2.pom
If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the `'metadataSources { ... }'` of the repository declaration.
上下文:我在 Windows 上使用 Gradle 版本 6.9。我的
build.gradle
文件的相关部分是:
plugins {
id 'com.bmuschko.docker-remote-api' version '3.6.2'
}
我已经尝试过:
运行
./gradlew clean
,然后 ./gradlew
构建。
检查我的互联网连接和存储库设置。
在其他存储库中搜索该插件。
问题:
我可以采取哪些步骤来解决此错误并找到所需的插件? 我应该考虑其他存储库或插件版本吗? 任何帮助将不胜感激!
要解决这个问题,您应该:
验证插件版本:检查 Gradle 插件门户上 com.bmuschko:gradle-docker-plugin:3.6.2 的可用性,以确保其正确。
切换存储库:在存储库 { ... } 下的构建脚本中将 JCenter 替换为 mavenCentral() 和 gradlePluginPortal()。
调整元数据源:如果需要,请在 Maven 存储库设置中配置metadataSources {artifact()},以便在 POM 元数据不存在时直接使用工件。
清除 Gradle 缓存: 清除 Gradle 缓存后执行 ./gradlew clean build --refresh-dependencies (类 Unix 系统上的 $HOME/.gradle/caches/ 或 %USERPROFILE%.gradl