Can the Grails plugin be excluded from the production environment?

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

+7
development-environment production-environment grails grails-plugin
source share
4 answers

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

Plugins can now be reached using the environment or predefined build areas:

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

Plugins will only load in these environments and will not be packaged in a WAR file. This allows plug-ins for development-only purposes not to be packaged for production use.

+5
source share

I don’t believe that there is a way to achieve this without editing the plugin itself (as Gene noted)

If you have control over the plugin, then it will work, but if you just want to configure it as you "used" it, then you will need to copy and run the fixed version of the plugin with your changes. You configure it using the custom location for this plugin in the grails-app / conf / BuildConfig.groovy file.

+3
source share

If you want to exclude a plugin in a specific environment, you need to do this:

 runtime (':plugin:version') { if (Environment.current == Environment.PRODUCTION) { export = false } } 
+3
source share

You can use the exception property in your config.groovy:

 production { grails.plugin.excludes='console,classDiagram' } 

But there seems to be some kind of confusion in that it excludes it from the "run-app" and "war". I will try to check today and check

0
source share

All Articles