是否可以从生产环境中排除 grails 插件? [英] Is it possible to exclude grails plugin from production environment?

查看:21
本文介绍了是否可以从生产环境中排除 grails 插件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在开发环境中使用某个插件,但想从生产和生成的战争中排除这个插件.实现此目标的最简单方法是什么?

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?

推荐答案

是的,使用插件范围.来自 http://grails.org/1.1+Release+Notes:

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']

插件只会在这些环境中加载,不会打包到 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.

这篇关于是否可以从生产环境中排除 grails 插件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆