Search code examples
grailsgrails-plugin

Exclude plugin for specific environment


I'm using grails 2.1.

I need to exclude a plugin when building for production.

This post mentions adding scopes to the plugins. I believe this requires editing indivudual plugin descriptors?

I would like to define plugins to exclude in one location.

I have tried adding the following to config.groovy:

environments {
    production {
    plugin.excludes='grails-melody'
    }
}

When I check the war it still contains the melody folder under WEB-INF/plugins.

I should add that most of the application plugins are specified in application.properties as follows:

plugins.build-test-data=2.0.3
plugins.fixtures=1.1
plugins.geoip=0.2
plugins.grails-melody=1.12
etc...

How can I exclude specific plugins for production builds?

Thanks


Solution

  • In your buildConfig.groovy you can define a plugin to not export:

    plugins {
      compile(':theplugin:theversion') {
        export = false
      }
    }