在 Grails 2.3.0 中,我的插件所依赖的插件在我运行 maven-install 时不会被导出。这适用于 2.2.3:
$ which grails
/Applications/grails-2.2.4/bin/grails
$ grails create-plugin myplugin
| Created plugin Myplugin
# add spring-security-core
$ cd myplugin; cat grails-app/conf/BuildConfig.groovy
...
plugins {
build(":tomcat:$grailsVersion",
":release:2.2.1",
":rest-client-builder:1.0.3") {
export = false
}
compile ":spring-security-core:1.2.7.3"
}
$ grails compile; grails maven-install
$ cat target/pom.xml|grep spring
<artifactId>spring-security-core</artifactId>
$ cat ~/.m2/repository/org/grails/plugins/myplugin/0.1/myplugin-0.1.pom|grep spring
<artifactId>spring-security-core</artifactId>
但不是在 2.3.0
$ which grails
/Applications/grails-2.3.0/bin/grails
$ grails create-plugin mynewplugin
| Created plugin Mynewplugin
# add spring-security-core
$ cd mynewplugin; cat grails-app/conf/BuildConfig.groovy
...
plugins {
build(":release:3.0.0",
":rest-client-builder:1.0.3") {
export = false
}
compile ":spring-security-core:1.2.7.3"
}
$ grails compile; grails maven-install
$ cat target/pom.xml|grep spring
$ cat ~/.m2/repository/org/grails/plugins/mynewplugin/0.1/mynewplugin-0.1.pom|grep spring
$
我的 application.properties 没有列出依赖项。我还尝试了从源代码构建的 Grails 2.3.1,但它的行为与 2.3.0 相同。目标是能够拥有一个依赖于其他插件的插件,并将这些依赖项导出到主应用程序,而无需主应用程序显式声明它们。这应该是可能的,如果是这样,我错过了什么?我已经阅读了很多其他相关的 stackoverflow 答案和 Grails 邮件列表,但没有任何东西可以为我解决这个问题。