如何配置Gradle以使嵌套的JAR文件在存储时不进行压缩?

huangapple go评论69阅读模式
英文:

How to configure gradle that nested jar files must be stored without compression?

问题

在我的 gradle 配置中,我想要强制要求嵌套的 jar 文件必须以无压缩方式存储。在 Maven 中,我们可以像下面这样定义配置:

build {
    pluginManagement {
        plugins {
            plugin {
                configuration {
                    archive {
                        compress = false
                    }
                }
            }
        }
    }
}
英文:

In my gradle configuration, I wanted to enforce that nested jar files must be stored without compression. In Maven, we can define the configuration like this below:

<build>
     <pluginManagement>
         <plugins>
             <plugin>
                 <configuration>
                     <archive>
                         <compress>false</compress>
                    </archive>
                </configuration>
            </plugin>
        </plugins>
    </pluginManagement>
  </build>

My question, how to configure such configuration with gradle?

答案1

得分: 1

有一个entryCompression属性适用于jar、zip、ear和tar插件(至少从gradle 5开始)。

实际的传播/配置取决于您的build.gradle文件。

英文:

There is a entryCompression attribute for the jar, zip, ear and tar plugins (since at least gradle 5).

The actual propagation/configuration is specific to your build.gradle.

huangapple
  • 本文由 发表于 2020年3月16日 19:15:50
  • 转载请务必保留本文链接:https://go.coder-hub.com/60704948.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定