且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

为什么Gradle不在本地Maven存储库中查找插件?

更新时间:2023-11-11 20:07:16

我认为指定自定义插件存储库看起来很有希望:此功能使您可以配置plugins{} DSL以从gradle插件门户网站之外的其他存储库中进行解析.我认为您想使用以下配置来更新settings.gradle:

I think that specifying a custom plugin repository looks promising: this feature lets you configure the plugins{} DSL to resolve from other repositories in addition to the gradle plugin portal. I think you'd want to update your settings.gradle with configuration something along the lines of:

pluginManagement {
  repositories {
      mavenLocal()
      gradlePluginPortal()
  }
}

(请注意,此代码块需要显示在settings.gradle的顶部).

(Note that this code block needs to appear at the top of settings.gradle).