Why does Gradle not look in the local maven repository for plugins?

前端 未结 2 750
离开以前
离开以前 2021-01-02 03:33

I have built a Gradle plugin and published it to the local maven repository. I can see it in my ~/.m2/repository. However, when I run a Gradle project to use this plugin, it

2条回答
  •  爱一瞬间的悲伤
    2021-01-02 03:58

    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()
      }
    }
    

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

提交回复
热议问题