在Grails2.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相同。目标是能够拥有一个依赖于其他插件的插件,并将这些依赖项导出到主应用程序,而不需要主应用程序显式声明它们。这是可能的吗?如果是的话,我遗漏了什么?我读过很多其他相关的堆叠溢出答案和Grails邮件列表,但是没有什么能为我澄清这一点。
发布于 2013-09-26 15:07:43
对于任何努力解决这个问题的人来说,这都是发布插件3.0.0版本中的一个错误或遗漏。它是在3.0.1中修复的,因此将其添加到您的BuildConfig.groovy并重新运行maven-install解决了这个问题:
build(":release:3.0.1",...以下是针对该bug的JIRA问题。
发布于 2013-09-25 11:33:14
在将我们的项目升级到使用Grails 2.3时,我也发现了这个问题。到目前为止,还没有发现原因,因为在某些情况下,生成的pom确实包含一些依赖项,但在大多数情况下并不是全部。然而,我发现了一项工作,它似乎让一切都可以建立起来:
use pom,以及grails.project.dependency.resolver = "maven"、checksums true和legacyResolve falsegrails maven-install或grails maven-deploy应该使用该pom并正确工作。我们已经将此与使用父pom和全局settings.groovy中的一些开关结合在一起,希望(在编写本报告时未经过测试)允许我们仍然内联。https://stackoverflow.com/questions/18996190
复制相似问题