简体   繁体   English

grails战争建立目标-如何指定“请勿压缩”?

[英]grails war build target - how to specify “DO NOT COMPRESS”?

Hi I want to build my wars in grails without compression to optimize rsync transfer. 嗨,我想在没有压缩的情况下建立我的战争,以优化rsync传输。 How can I specify this option? 如何指定此选项?

As shown here, I want compress=false, as in 如此处所示,我希望compress = false,如
http://ant.apache.org/manual/Tasks/war.html http://ant.apache.org/manual/Tasks/war.html

I specifically want to know how to do it using the grails war task target, ie, something like 我特别想知道如何使用grails战争任务目标来做到这一点,例如

$ grails war -compress=false $ grails war -compress = false

Can anyone tell me how to do this?? 谁能告诉我该怎么做?

Thanks! 谢谢! Jamie 杰米

Both the jar and war plugins now have an entryCompression property. jar和war插件现在都具有entryCompression属性。

Example: 例:

war {
     entryCompression = ZipEntryCompression.STORED
}

From Gradle API Documentation Gradle API文档

The compression level of the entries of the archive. 归档条目的压缩级别。 If set to ZipEntryCompression.DEFLATED (the default), each entry is compressed using the DEFLATE algorithm. 如果设置为ZipEntryCompression.DEFLATED(默认设置),则使用DEFLATE算法压缩每个条目。 If set to ZipEntryCompression.STORED the entries of the archive are left uncompressed. 如果设置为ZipEntryCompression.STORED,则存档的条目将保持未压缩状态。

If you look at the docs for the war command there is no such option. 如果查看war命令的文档 ,则没有此类选项。 The only way you'll be able to achieve this is by writing your own grails command (using GAnt) that invokes the underlying Ant task with the compress=false option. 实现此目标的唯一方法是编写自己的grails命令 (使用GAnt),该命令使用compress=false选项调用基础Ant任务。 You should then put this in the scripts directoy of your app or a plugin if you want to reuse it across several apps. 然后,如果要在多个应用程序中重复使用它,则应将其放在应用程序或插件的scripts目录中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM