把更多的信息放在Grails战争中 [英] Putting more info in a grails wars

查看:78
本文介绍了把更多的信息放在Grails战争中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Grails允许我们很容易地打包一场战争:
$ b

  grails war 

我想在战争中的某个地方使用更多元信息。它是什么时候建成的等等。是否有一个开关,将创建这样的文件,并填充元信息。

AFAIK没有开关添加关于战争创建的元数据,但是您可以在BuildConfig中使用此条目添加/删除战争期间的战争内容。

  grails.war.resources = {stagingDir  - > 
copy(todir:$ {stagingDir}){
fileset(dir:$ {basedir} / path / to / your / meta-info / files){
//排除不需要的文件
exclude(名称:** / excluded-file)
}
}

//如果您想从暂存中删除某些内容dir
delete(file:$ {stagingDir} /WEB-INF/lib/<deleteSome.jar>)
}


Grails allows us to package up a war very easily with

grails war

I would likemore meta - info somewhere in the war. What time it was built at etc. Is there a switch that will create such a file and fill it with meta info.

解决方案

AFAIK there is no switch to add metadata about the war creation but you can add/delete contents to war during war generation by using this entry in BuildConfig.

grails.war.resources = { stagingDir ->
    copy(todir: "${stagingDir}") {
        fileset(dir:"${basedir}/path/to/your/meta-info/files") {
            //Exclude unwanted files
            exclude(name:"**/excluded-file")
        }
    }

    //In case you want to remove something from the staging dir
    delete(file:"${stagingDir}/WEB-INF/lib/<deleteSome.jar>")
}

这篇关于把更多的信息放在Grails战争中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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