Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to exclude grails plugin from production environment?

I would like to use certain plugin in development environment, but would like to exclude this plugin from production and from generated war. What is the easiest way to accomplish this?

like image 993
Dan Avatar asked Nov 23 '09 14:11

Dan


2 Answers

Yes, using plugin scopes. From http://grails.org/1.1+Release+Notes:

Plugins can now be scoped using either the environment or predefined build scopes:

def environments = ['dev', 'test']
def scopes = [excludes:'war']

The plugins will only load in those environments and will not be packaged into the WAR file. This allows "development-only" plugins to not be packaged for production use.

like image 118
Jean Barmash Avatar answered Oct 19 '22 14:10

Jean Barmash


I don't believe that there is a way to achieve this without editing the plugin itself (as Jean pointed out)

If you have control over the plugin then that will work, but if you just wanted to configure this as you were 'using' it, then you will need to copy and run a patched version of the plugin with your modifications. You'd customizing it by utilizing a custom location for that plugin in your grails-app/conf/BuildConfig.groovy file.

like image 28
Colin Harrington Avatar answered Oct 19 '22 15:10

Colin Harrington