Search code examples
grails-plugingrails-2.0

Recommened way to install grails plugins


What is the recommended way to include a grails plugin for in a 2.1.0 project?

1: Add it to the 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: Specify it in 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'
    }

Thanks


Solution

  • I would always put it in buildConfig.groovy since this allows

    1. to define the scope of the dependency
    2. exclude unwanted dependencies, which can save you a lot of trouble

    Btw: found an interesting thread on this here, that actually treats the exact same question:

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

    HTH