0

在 2.1.0 项目中包含 grails 插件的推荐方法是什么?

1:添加到application.properties?

app.grails.version=2.1.0
app.name=testapp-local
app.version=0.1
plugins.build-test-data=2.0.3
plugins.fixtures=1.1
plugins.hibernate=2.1.0
plugins.pretty-time=0.3
plugins.mail=1.0
plugins.quartz=0.4.2
plugins.spring-security-core=1.2.7.3
plugins.tomcat=2.1.0

2:在buildConfig.groovy中指定?

plugins {
        runtime ":hibernate:$grailsVersion"
        runtime ":jquery:1.7.2"
        runtime ":resources:1.1.6"

        // Uncomment these (or add new ones) to enable additional resources capabilities
        //runtime ":zipped-resources:1.0"
        //runtime ":cached-resources:1.0"
        //runtime ":yui-minify-resources:0.1.4"

        build ":tomcat:$grailsVersion"

        runtime ":database-migration:1.1"

        compile ':cache:1.0.0'
    }

谢谢

4

1 回答 1

4

我总是把它放在 buildConfig.groovy 因为这允许

  1. 定义依赖的范围
  2. 排除不需要的依赖,可以省去很多麻烦

顺便说一句:在这里找到了一个有趣的线程,它实际上处理了完全相同的问题:

http://grails.1312388.n4.nabble.com/Plugins-application-properties-vs-BuildConfig-groovy-td4313370.html

高温高压

于 2012-12-13T17:03:03.820 回答