排除特定环境的插件 [英] Exclude plugin for specific environment

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

问题描述

我正在使用grails 2.1.

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.

我尝试将以下内容添加到config.groovy:

I have tried adding the following to config.groovy:

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

当我检查战争时,它仍然包含WEB-INF/plugins下的melody文件夹.

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

我应该补充一点,大多数应用程序插件是在application.properties中指定的,如下所示:

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?

谢谢

推荐答案

在buildConfig.groovy中,您可以定义一个不导出的插件:

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

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

这篇关于排除特定环境的插件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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