建议使用grails插件的方法

时间:2012-12-13 16:56:53

标签: grails-plugin grails-2.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'
    }

由于

1 个答案:

答案 0 :(得分:4)

我总是将它放在buildConfig.groovy中,因为这允许

  1. 定义依赖的范围
  2. 排除不需要的依赖项,这可以为您节省很多麻烦
  3. 顺便说一下:在这里找到了一个有趣的线索,实际上是对待完全相同的问题:

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

    HTH