【问题标题】:What happens when Grails BuildConfig scope doesn't specify organization?当 Grails BuildConfig 范围没有指定组织时会发生什么?
【发布时间】:2025-12-12 05:30:02
【问题描述】:

在 Grails 应用程序的 BuildConfig.groovy 中,您可以指定 repos 以在其中查找依赖项/插件:

repositories {
    mavenRepo: "http://path/to/my/repo"
}

plugins {
    compile: "fizz:buzz:0.4.3"
}

在上面的例子中,Grails 将在上面提到的 repo 中寻找一个 buzz-0.4.3.zip 插件。它的“组织”段是fizz,这是编写buzz-0.4.3.zip 的组织的名称。

但我一直看到compile 作用域是这样写的:

compile: ":buzz:0.4.3"

我搜索了BuildConfig documentation,但似乎无法找到他们在哪里解释当范围中缺少这个“组织”部分时会发生什么。

所以我问:不指定组织是什么意思?是否应用了默认值?什么时候适合使用组织?

【问题讨论】:

  • 肯定有一个默认应用到 plugin 依赖项
  • 感谢@IanRoberts (+1) - 很好的收获,我本来打算放 plugins 而不是 dependencies,请参阅更新。想法?

标签: maven grails ivy buildconfig


【解决方案1】:

来自文档(4.7.11 - plugin dependencies 部分)

如果您不指定组 id,则使用默认插件组 id org.grails.plugins

(“组 ID”是 Maven 术语,用于您所谓的“组织”)。 https://grails.org/plugins/ 列出的所有标准插件都使用默认组 ID。

【讨论】:

    最近更新 更多